Hello,

I am using Perl 5.8 on WindowsXP and Windows Server 2003.  I can not get the 
following attachment to arrive/attach even though I get the email with no 
issues.  Any ideas?

  use MIME::Lite;
 use Net::SMTP;
 
 unless (-e 'C:/my_file.log' && -s 'C:/my_file.log' ) { print "file not 
found\n"; }
 
  my $msg = MIME::Lite->new (
    From => 'my_em...@yahoo.com',
    To => 'your_em...@yahoo.com',
    Subject => 'Testing error email',
    Type =>'multipart/mixed'
  ) or die "Error creating multipart container: $!\n";
  
 $msg->attach (
    Type => 'TEXT',
    Data => 'Error in the module that caused this email',
  ) or die "Error adding the body text to email message: $!\n";
 
   $msg->attach (
     Type => 'TEXT',
     Path => 'C:/my_file.log',
     Filename => 'my_file.log',
     Disposition => 'attachment'
     ) or die "Error adding file attachment: $!\n";

  MIME::Lite->send('smtp', 'smtp.server.net', Timeout=>60);
  $msg->send; 
 
__END__

Thank you!


      

Reply via email to