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!