in reply to Re: Emailing attachments.
in thread Emailing attachments.

I am not familiar with binmode. Is it something to do with encoding? Below is my code where i think the problem might be.
my $msg = MIME::Lite->new( From => 'fromid', To => "toid", Subject =>'Web trial for today', Type => 'multipart/mixed', ); $msg->attach( Type => 'application/vnd.ms-excel', Path => '/root/Webtrial.xls', Id => 'Webtrial.xls', ); my $mailer = new Net::SMTP::TLS( 'smtp.gmail.com', Port => '587', User => 'username', Password => 'xxxxxxxxxxx' ); $mailer->mail('fromid'); $mailer->to('toid'); $mailer->data; $mailer->datasend($msg->as_string); $mailer->dataend; $mailer->quit;