Try the paths like this C:\\my_file.log
-----Original Message----- From: Robert H [mailto:sigz...@gmail.com] Sent: Tuesday, December 08, 2009 6:58 PM To: beginners@perl.org Subject: Re: Email does not send attachment ... On 12/8/09 3:56 PM, Tony Esposito wrote: > 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; I see why you do that now. Sorry. Bob -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/ -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/