Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Send Email to GMAIL with html body

by Maktub (Initiate)
on Mar 23, 2013 at 16:13 UTC ( #1025039=note: print w/replies, xml ) Need Help??


in reply to Re: Send Email to GMAIL with html body
in thread Send Email to GMAIL with html body

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
Node Status?
node history
Node Type: note [id://1025039]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2018-07-23 05:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (459 votes). Check out past polls.

    Notices?