Sample code for 30+ languages & platforms
PowerShell Requires Chilkat v11.0.0+

Transition from MailMan.FetchSingleHeader to MailMan.FetchOne

Provides instructions for replacing deprecated FetchSingleHeader method calls with FetchOne.

Chilkat PowerShell Downloads

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

$success = $false

$mailman = New-Object Chilkat.MailMan

#  ...
#  ...

$numBodyLines = 5
$msgnum = 1

#  ------------------------------------------------------------------------
#  The FetchSingleHeader method is deprecated:

$emailObj = $mailman.FetchSingleHeader($numBodyLines,$msgnum)
if ($mailman.LastMethodSuccess -eq $false) {
    $($mailman.LastErrorText)
    exit
}

#  ...
#  ...

#  ------------------------------------------------------------------------
#  Do the equivalent using FetchOne.
#  Your application creates a new, empty Email object which is passed 
#  in the last argument and filled upon success.

$headerOnly = $true

$emailOut = New-Object Chilkat.Email
$success = $mailman.FetchOne($headerOnly,$numBodyLines,$msgnum,$emailOut)
if ($success -eq $false) {
    $($mailman.LastErrorText)
    exit
}