Hi,

Funnily enough, I was just playing with that :)
use Net::SMTP; my $smtp = Net::SMTP->new('smtp.gmail.com', Hello => 'smtp.gmail.com', Timeout => 30, Debug => 1, SSL => 1 ) || die "Error: $!"; $smtp->auth($CFG->{db_smtp_user}, $CFG->{db_smtp_pass}) or die "C +ould not authenticate with mail.\n"; $smtp->data(); $smtp->datasend($email) || die $!; $smtp->dataend() || die $smtp->message();


It complains on line 99, which is:

$smtp->dataend() || die $!;

Which gives the following error message:

5.5.1 Unrecognized command. vs7sm25292357wjb.10 - gsmtp


I found a similar post here: http://www.perlmonks.org/?node_id=680369, but I'm not quite sure what the suggestion is (it also 2008, so I'm not sure if its relative any more)

Just to clarify a bit more, this is the debug that reports the error:

Net::SMTP::_SSL>>> Net::SMTP::_SSL Net::SMTP::_SSL>>> IO::Socket::SSL(2.019) Net::SMTP::_SSL>>> IO::Socket::IP(0.32) Net::SMTP::_SSL>>> IO::Socket(1.38) Net::SMTP::_SSL>>> IO::Handle(1.35) Net::SMTP::_SSL>>> Exporter(5.71) Net::SMTP::_SSL>>> Net::SMTP(3.10) Net::SMTP::_SSL>>> Net::Cmd(3.10) ******* Net::SMTP::_SSL=GLOB(0x1f5e100)<<< 220 smtp.gmail.com ESMTP y2sm147858 +26wjx.20 - gsmtp ******* Net::SMTP::_SSL=GLOB(0x1f5e100)>>> EHLO localhost.localdomain Net::SMTP::_SSL=GLOB(0x1f5e100)<<< 250-smtp.gmail.com at your service, + [2a01:7e00::f03c:91ff:fea8:e2c5]


Cheers

Andy

In reply to Re^4: Send email via Gmail by ultranerds
in thread Send email via Gmail by ultranerds

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.