» estematt - MIME::LITE hangs
below is perl script code
#!/usr/local/bin/perl
$filedir = $ENV{HRPRNETDIR}.'/cobra/';
chdir $filedir;
@list = `ls $detailfile`;
chomp @list;
while (@list) {
$attachment = shift @list;
use MIME::Lite;
my $msg = MIME::Lite-new( To= 'jfimbel@nbty.com',
From = 'NBTY WW501PROD Lawson job',
Subject = 'WWAGESCOBRA.csv attached',
Type = 'multipart/mixed');
$msg-attach(Path = $attachment,
Type = 'Auto',
Disposition = 'attachment');
$msg-send;
}
sub EmailError {
$errmsg = @_[0]."\n";
use MIME::Lite;
my $msg = MIME::Lite-new( To= 'jfimbel@nbty.com',
From = 'NBTY WWW501PROD Lawson job',
Subject = 'Error',
Type = 'multipart/mixed');
$msg-attach(Type = 'TEXT' , Data = $errmsg);
$msg-send;
exit;
}
-- posted by estematt
»
Guy Lecky-Thompson
- MIME::LITE hangs
Hello,
My understanding of MIME::Lite is that it invokes sendmail as a new process and gets it to send the mail on. This relies so much on other aspects of the system that it is no surprise that it is slow.
A much better strategy is to directly put the message on the local mail server queue, using Mail::sendmail, rather than the default behavior of MIME::Lite which spawns a new sendmail instance which startup and shutdown is what is probably causing your problem.
I'd like to know how it pans out.
Regards,
Guy
Please follow the guidelines set forth in the Suite101 Posting Etiquette when adding to the discussion.