Computer Programming

© Guy Lecky-Thompson

perl MIME::LITE

  1. estematt
  2. Guy Lecky-Thompson


Reply   Post   Top
1.   Sep 19, 2007 7:55 AM

» estematt - MIME::LITE hangs


We installed new UNIX RS6000 server perl script uese MIME::LITE to send email via Lotus Notes process time is slow eventually after 1 minute return to prompt

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

Permalink Print Discussion Print Discussion Email Discussion Email Discussion Suite101: perl MIME::LITE How to subscribe to feeds

Reply   Post   Top
2.   Sep 21, 2007 5:28 AM

» Feature Writer Guy Lecky-Thompson - MIME::LITE hangs

In response to MIME::LITE hangs posted by estematt:


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

Suite101
Permalink Print Discussion Print Discussion Email Discussion Email Discussion Suite101: perl MIME::LITE How to subscribe to feeds

Please follow the guidelines set forth in the Suite101 Posting Etiquette when adding to the discussion.