MIME Lite

[email protected] Thu, 10 Jul 2003 15:05:50 -0400
Newsgroups perl.macperl.modules
Message-ID <[email protected]>
------_=_NextPart_001_01C34716.46FF1280
Content-Type: text/plain;
	charset="iso-8859-1"

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 => '[email protected]',
                To   => '[email protected]',
                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";

------_=_NextPart_001_01C34716.46FF1280--