How do i send email as HTML format using Net::SMTP_auth

A

arun

Hi
How do i send HTML Mail using Perl Module Net::SMTP_auth. Right now i
can able to send the mail but the receipents are able to view all the
HTML tags. How to resolve this.

With Regards
Arun
 
M

Mike

Arun,

I use MIME::Lite to form the email body before sending.
Here $pagetosend is the whole html page.

-------code snip--------
use MIME::Lite;

### Create the multipart container
my $msg = MIME::Lite->new (
From => $from_address,
To => $to_address,
Subject => $subject,
Type => 'text/html',
Data=> $pagetosend
) or die "Error creating inline email $!\n";
## prep msg for Net:SMTP
my $msg_body = $msg ->as_string();

---- end snip-----
Now you have an encapsulated html page to insert.

so now just

---- snip 2-----
$smtp->data();
$smtp->datasend($msg_body);
$smtp->dataend();
$smtp->quit();
---- end snip 2 -----

Now this has been working for me for a long time using Net::SMTP.

Hope it helps,

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top