in reply to Sending HTML-formatted email

Check out Mail::Sender for sending the email HTML and plain text. You can send it multipart so it doesn't get blocked by a SPAM filter.
use Mail::Sender; my $text_msg = "foo"; my $html_msg = "<p>foo</p>"; my $sender = new Mail::Sender { smtp => '127.0.0.1', from => "Teacher <me\@mydomain.com>", } $sender->OpenMultipart( { to => "$rcpt", subject => "$subject", multipart => "mixed", }) or die "Can't Open message: $sender->{'error_msg'}\n"; $sender->Part( { ctype => 'multipart/alternative' }); $sender->Part( { ctype => 'text/plain', disposition => 'NONE', msg => "$text_msg\n" }); $sender->Part( { ctype => 'text/html', disposition => 'NONE', msg => "$html_msg\n" }); $sender->Close() or die "Failed to send message: $sender->{'error_msg'}\n";

Replies are listed 'Best First'.
Re^2: Sending HTML-formatted email
by davorg (Chancellor) on Nov 21, 2006 at 13:26 UTC
    from => "Teacher <me\@mydomain.com>",

    If you didn't use double quotes there, then you wouldn't need to escape the '@' character.

    from => 'Teacher <me@mydomain.com>',

    And that's one less potentially confusing piece of punctuation for your maintenance programmer[1] to deal with.

    [1] Yes. That might be you :-)

    --
    <http://dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg