PowerShell
PowerShell
Transition from Imap.ListSubscribed to Imap.MbxList
Provides instructions for replacing deprecated ListSubscribed method calls with MbxList.Chilkat PowerShell Downloads
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"
$success = $false
$imap = New-Object Chilkat.Imap
# ...
# ...
$reference = ""
$mbxPattern = "*"
# ------------------------------------------------------------------------
# The ListSubscribed method is deprecated:
# Lists only subscribed mailboxes.
$mboxesObj = $imap.ListSubscribed($reference,$mbxPattern)
if ($imap.LastMethodSuccess -eq $false) {
$($imap.LastErrorText)
exit
}
# ...
# ...
# ------------------------------------------------------------------------
# Do the equivalent using MbxList.
# Your application creates a new, empty Mailboxes object which is passed
# in the last argument and filled upon success.
# Lists only subscribed mailboxes.
$subscribed = $true
$mboxes = New-Object Chilkat.Mailboxes
$success = $imap.MbxList($subscribed,$reference,$mbxPattern,$mboxes)
if ($success -eq $false) {
$($imap.LastErrorText)
exit
}