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

I am using the mail::mailer program to send emails in my perl script. But when i am adding the HTML tags they show up as it is. it does not show as the web page. I even tried adding the headers of mime type like
Mime-Version: 1.0<br> Content-Type: text/html; charset="us-ascii"
so to be more precise, when i type <a href="www.perlmonks.org">link</a> should show as "link " not as the whole html tags.
Thanks
Turum.

Edit ar0n -- moved to SOPW

Replies are listed 'Best First'.
(bbfu) (MIME::Lite) Re: Sending html mail with Mail::Mailer
by bbfu (Curate) on Aug 20, 2001 at 20:09 UTC

    Mail::Mailer does not do any of the MIME work for you. It just sends the text you give it as the body of the mail, as is. If you want to do MIME encoding (including setting Content-Type's) you need to build the MIME message yourself.

    Check out MIME::Lite. Update: MIME::Lite will not only do the encoding for you, it will also send the mail using either sendmail, or Net::SMTP (just like Mail::Mailer). So you should only need MIME::Lite. :-)

    bbfu
    Seasons don't fear The Reaper.
    Nor do the wind, the sun, and the rain.
    We can be like they are.

Re: Sending html mail with Mail::Mailer
by princepawn (Parson) on Aug 20, 2001 at 21:06 UTC
Re: Sending html mail with Mail::Mailer
by drfrog (Deacon) on Aug 20, 2001 at 21:05 UTC
    Hey there

    ive always used Mail::Sender

    mostly cuz it does attachements too :)

    i was pleasantly surprised one day when i needed to do an
    html mailout and Mail::Sender could handle this:

    use Mail::Sender; sub mail { my $sender; my $return = ""; $sender = new Mail::Sender( { from => 'dot@bomb.com', smtp => 'dot@bomb.com' } ) or $return = "$Mail::Sender::Error\n"; $sender->MailMsg( { to => $_[0], subject => $_[2], bcc =>'dot@bomb.com', msg => $_[1], ctype => 'text/html', } ) or $return = "$Mail::Sender::Error\n"; return "$return";


    hope that helps


    back in the day we didnt have no old school
Not actually related, but:
by Cine (Friar) on Aug 20, 2001 at 19:24 UTC