(Perl) Transition from MailMan.LoadMime to Email.SetFromMimeText
Provides instructions for replacing deprecated LoadMime method calls with Email.SetFromMimeText. Note: This example requires Chilkat v11.0.0 or greater.
use chilkat();
$mailman = chilkat::CkMailMan->new();
# ...
# ...
$mimeText = "....";
# ------------------------------------------------------------------------
# The LoadMime method is deprecated:
# emailObj is a Email
$emailObj = $mailman->LoadMime($mimeText);
if ($mailman->get_LastMethodSuccess() == 0) {
print $mailman->lastErrorText() . "\r\n";
exit;
}
# ...
# ...
# ------------------------------------------------------------------------
# Do the equivalent using Email.SetFromMimeText.
$email = chilkat::CkEmail->new();
$success = $email->SetFromMimeText($mimeText);
if ($success == 0) {
print $email->lastErrorText() . "\r\n";
exit;
}
|