Hi.

Im' tring to send email with perl with my gmail account and insert a link in email's body.

I try many codes, but i can "send email with gmail NO Links" or "send html email but NO with gmail account". I google for two days, search in perlmonks but I cannot send email.

I use:

1. Email::Send and I can send email to gmail, but with simple body, no html.

my $sender = Email::Send->new( { mailer => 'Gmail', mailer_args => [ username => $username, password => $password, ] } );

2. I use Mime::Lite but i have this Error: SMTP auth() command not supported on smtp.gmail.com:587

MIME::Lite->send('smtp', 'smtp.gmail.com:587', Timeout => 60,AuthUser= +>$user, AuthPass=>$pass);$msg->send();

3. I use Net::SMTP::TLS but but i have this Error: Couldn't start TLS: Cannot determine peer hostname for verification

my $smtp = new Net::SMTP::TLS( 'smtp.gmail.com', Hello => 'test.org', Port => 587, User => $user, Password=> $password, Timeout => 30 );

Someone can help please?

Thanks in advice. Andrea

In reply to Send Email to GMAIL with html body by Maktub

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.