develooper Front page | perl.macperl.modules | Postings from July 2003

MIME Lite

From:
pyounge
Date:
July 10, 2003 13:47
Subject:
MIME Lite
Message ID:
22839A473A19AA40AC016610CEB6C78B39BE27@USPS.ivillage.net
running a script via cron, and I get the following error message.

Am wondering if MIME lite is the problem?

thanks,

--patricia


Failed to connect to mail server: Bad file number
 at

use MIME::Lite;

my $mime_msg = MIME::Lite->new(
                From => 'pyounge@mail.ivillage.com',
                To   => 'pyounge@mail.ivillage.com',
                Subject => $file,
                Type => 'TEXT',
                Data => ""
         )
  or die "Error creating MIME body: $!\n";
my $filename = "$file";
my $recommended_filename = "$file.xls";

# Attach the test file
$mime_msg->attach(
   Type => 'TEXT',
   Path => $filename,
   Filename => $recommended_filename
   )
  or die "Error attaching test file: $!\n";

my $ServerName = "xxx.ivillage.com";

# Let MIME::Lite handle the Net::SMTP details
MIME::Lite->send('smtp', $ServerName);
$mime_msg->send() or die "Error sending message: $!\n";




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About