(PowerShell) Transition from MailMan.LoadXmlFile to EmailBundle.LoadXml
Provides instructions for replacing deprecated LoadXmlFile method calls with EmailBundle.LoadXml. Note: This example requires Chilkat v11.0.0 or greater.
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"
$mailman = New-Object Chilkat.MailMan
# ...
# ...
$filePath = "c:/example/emailBundle.xml"
# ------------------------------------------------------------------------
# The LoadXmlFile method is deprecated:
$bundleObj = $mailman.LoadXmlFile($filePath)
if ($mailman.LastMethodSuccess -eq $false) {
$($mailman.LastErrorText)
exit
}
# ...
# ...
# ------------------------------------------------------------------------
# Do the equivalent using EmailBundle.LoadXml.
$bundle = New-Object Chilkat.EmailBundle
$success = $bundle.LoadXml($filePath)
if ($success -eq $false) {
$($bundle.LastErrorText)
exit
}
|