in reply to Send Email to GMAIL with html body

At least you can use Email::Sender because:

Email::Send is going away... well, not really going away, but it's being officially marked "out of favor."

But I have good results using a higher level module: Mail::Builder::Simple.

Regards, Stefan.

Replies are listed 'Best First'.
Re^2: Send Email to GMAIL with html body
by Maktub (Initiate) on Mar 23, 2013 at 16:13 UTC
    Hi.

    Thanks for your reply.

    I write this code:
    use strict; use Email::Sender::Simple qw(sendmail); use Email::Simple; use Email::Simple::Creator; use Email::Sender::Transport::SMTP::TLS; use Email::Sender::Simple qw(try_to_sendmail); my $username = 'xxx@gmail.com'; my $password = 'xxx'; my $to = 'xxx@gmail.com'; my $from = 'yyy@gmail.com'; my $subject = 'Test'; my $transport = Email::Sender::Transport::SMTP::TLS->new( host => 'smtp.gmail.com', port => 587, username => $username, password => $password ); my $email = Email::Simple->create( header => [ To => $to, From => $from, Subject => $subject, ], body => "This message is short, but at least it's cheap.\n", ); sendmail($email, { transport => $transport });

    I can send simple text email. It works fine. What changes i need to send html email? If i use Mime i cannot use Mail::Sender.

    Can i create another type of $email that works with sendmail?

    Thanks. Andrea