I'm using MIME::Lite in a Perl script to send am email with sendmail.
It works find as long as the email addresses are good, but if somebody puts a badly formated email address into the database, it causes a sendmail error which kills the script.
error closing /usr/lib/sendmail: (exit 17152)
I've tried variations of the send line (like the one below) to make the script print an error message and continue, but I haven't been able to figure out how to get the script to keep going even if the email fails.
Does anybody know how I can make it keep going when sendmail has an error?
_________
Rott Paws
...It's not a bug. It's an undocumented feature!!!
Code:
$msg = MIME::Lite->new(
From => $From,
To => $To,
Cc => $CC,
Subject => $Sub,
Bcc => $BCC,
Type => 'multipart/mixed');
$msg->attach(
Type => $BodyType,
Data => $Body);
$msg->send('sendmail', SetSender=>1);
It works find as long as the email addresses are good, but if somebody puts a badly formated email address into the database, it causes a sendmail error which kills the script.
error closing /usr/lib/sendmail: (exit 17152)
I've tried variations of the send line (like the one below) to make the script print an error message and continue, but I haven't been able to figure out how to get the script to keep going even if the email fails.
Code:
$msg->send('sendmail', SetSender=>1) || print "Error sending message:\n";
Does anybody know how I can make it keep going when sendmail has an error?
_________
Rott Paws
...It's not a bug. It's an undocumented feature!!!