Suite101

Computer Programming

© Mark Alexander Bain

perl MIME::LITE

  1. estematt


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


Post this Discussion Post to facebook Add this Discussion Post to del.icio.us! Digg this Discussion Post furl this Discussion Post Add this Discussion Post to Reddit Add this Discussion Post to Technorati Add this Discussion Post to Newsvine Add this Discussion Post to Windows Live Add this Discussion Post to Yahoo Add this Discussion Post to StumbleUpon Add this Discussion Post to BlinkLists Add this Discussion Post to Spurl Add this Discussion Post to Google Add this Discussion Post to Ask Add this Discussion Post to Squidoo


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