Sample code for 30+ languages & platforms
PowerShell

Transition from MailMan.TransferMultipleMime to MailMan.FetchMimeBd

Provides instructions for replacing deprecated TransferMultipleMime method calls with FetchMimeBd.

Chilkat PowerShell Downloads

PowerShell
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"

$success = $false

$mailman = New-Object Chilkat.MailMan

# ...
# ...

$saUidls = New-Object Chilkat.StringArray
$saUidls.Append("aaa")
$saUidls.Append("bbb")
$saUidls.Append("ccc")

$stUidls = New-Object Chilkat.StringTable
$stUidls.Append("aaa")
$stUidls.Append("bbb")
$stUidls.Append("ccc")

# ------------------------------------------------------------------------
# The TransferMultipleMime method is deprecated:

$sa = $mailman.TransferMultipleMime($saUidls)
if ($mailman.LastMethodSuccess -eq $false) {
    $($mailman.LastErrorText)
    exit
}

# ...
# ...

# ------------------------------------------------------------------------
# Do the equivalent using FetchMimeBd.

$mailman.ImmediateDelete = $false

$success = $false
$bdMime = New-Object Chilkat.BinData
$numUidls = $stUidls.Count
$i = 0
while ($i -lt $numUidls) {
    $success = $mailman.FetchMimeBd($stUidls.StringAt($i),$bdMime)
    # ...

    # Mark the email for deletion.
    $success = $mailman.DeleteByUidl($stUidls.StringAt($i))
    # ...

    $i = $i + 1
}

# emails marked for deletion will be deleted at this time
$success = $mailman.Pop3EndSession()