satyas has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, I have been using Mail::Sender for sending mail with attachment. Is there a way of sending mail with attachment along with a HTML message body.We dont need any files or links on the message body though.The message body is simple html with tables. But along with this i have to send two excel files as attachment. Please let me know if you have any pointer.Thanks.

Replies are listed 'Best First'.
Re: Mail attachment with html message body
by Anonymous Monk on Apr 16, 2012 at 17:20 UTC
Re: Mail attachment with html message body
by brx (Pilgrim) on Apr 16, 2012 at 20:48 UTC
      $emaildata="<h1>Hello World</h1>"; my $msg = MIME::Lite->new ( Subject=>"Hello World", From=>'youremail@yourdomain', To=>'destinationemailid', Type=>'text/html', Data=>$emaildata, ); MIME::Lite->send('smtp',"localhost:25",Debug=>0,Timeout=>60); $msg->send();
Re: Mail attachment with html message body
by Anonymous Monk on Apr 17, 2012 at 00:42 UTC

    Hi,

    Both of these scenaria are dealt with in the Mail::Sender docs. Raed carefully and then it's pretty much copy and paste.

    I like this module, it does everything I need, and is well documented.

    J.C.

Re: Mail attachment with html message body
by mendeepak (Scribe) on Apr 18, 2012 at 10:08 UTC
      Check out the other answers in this node.


      I'm too lazy to be proud of being impatient.