Hi Monks, I'm trying to send a simple email (hello world text) from my gmail account. Searching cpan I found the module Email::Send::Gmail. After installing it successfully, I'm running the synopsis-like snippet to test it:
#!/usr/bin/perl use strict; use warnings; use Email::Send; use Email::Send::Gmail; use Email::Simple::Creator; my $email = Email::Simple->create( header => [ From => 'magic_monitoring@gmail.com', To => 'acme@astray.com', Subject => 'Server down', ], body => 'The server is down. Start panicing.', ); my $sender = Email::Send->new( { mailer => 'Gmail', mailer_args => [ username => 'magic_monitoring@gmail.com', password => 'XXX', ] } ); eval { $sender->send($email) }; die "Error sending email: $@" if $@;
Replacing the gmail accounts and the password with valid ones. The context of execution is: Ubuntu 8.04 (uname -a: Linux 2.6.24-21-generic #1 SMP Mon Aug 25 17:32:09 UTC 2008 i686 GNU/Linux) perl -v -> v5.8.8 perl -MEmail::Send::Gmail -e 'print $Email::Send::Gmail::VERSION' -> 0.33 telnet smtp.gmail.com 995 -> Trying 216.239.59.109... Connected to gmail-smtp-msa.l.google.com. Escape character is '^]' Output of running the script: Error sending email: Email::Send::Gmail: error authenticating username myaccount@gmail.com at /usr/local/share/perl/5.8.8/Email/Send.pm line 243 Anyone have any idea what's going on here? (the script worked on a leopard plataform) Thanks in advance!

In reply to Sending a simple email using Email::Send::Gmail by diffredential

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.