Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Send Email to GMAIL with html body

by stefbv (Curate)
on Mar 23, 2013 at 11:03 UTC ( [id://1025021]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1025021]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-26 06:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found