PowerShell
PowerShell
Transition from MailMan.LoadEml to Email.LoadEml
Provides instructions for replacing deprecated MailMan.LoadEml method calls with Email.LoadEml.Chilkat PowerShell Downloads
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"
$success = $false
$mailman = New-Object Chilkat.MailMan
# ...
# ...
$filePath = "c:/dir/example.eml"
# ------------------------------------------------------------------------
# The MailMan.LoadEml method is deprecated:
$emailObj = $mailman.LoadEml($filePath)
if ($mailman.LastMethodSuccess -eq $false) {
$($mailman.LastErrorText)
exit
}
# ...
# ...
# ------------------------------------------------------------------------
# Do the equivalent using Email.LoadEml.
$email = New-Object Chilkat.Email
$success = $email.LoadEml($filePath)
if ($success -eq $false) {
$($email.LastErrorText)
exit
}