I am trying to use Email::Send::Gmail to send an email, but for some reason I am getting an error that it is not allowing me to connect.
The code is the standard exa
Time to upgrade your dependencies.
Email::Gmail::Send depends on Net::SMTP::SSL which depends on IO::Socket::SSL. The first step I take to solving this type of problem is to upgrade the module dependencies just in case a new issue has already been addressed.
Unfortunately, 4 Days ago when you first introduced this problem, I was unable to pass the test suite for IO::Socket::SSL 1.986
on Strawberry Perl 5.18.2
.
t/public_suffix_lib_uri.t ......... ok
failed to connect: An operation was attempted on something that is not a socket. at t/public_suffix_ssl.t line 87.
# Looks like you planned 24 tests but ran 2.
# Looks like your test exited with 10038 just after 2.
Fortunately, since then the author has updated the module to IO::Socket::SSL 1.988
, and I'm able to fully install and use it on both Windows 7 and Linux. Currently it throws redefined warnings (cpan ticket 95881), but I was able to send Gmail messages on Windows after upgrading this dependency.
Note: You'll want to create an application specific password for this code, otherwise Gmail might block the login and send you a "Suspicious sign in prevented" email.
Just Upgrade your active Perl version.
Then Install following modules: ppm
#!/home/ben/software/install/bin/perl
use warnings;
use strict;
use Email::Send;
use Email::Send::Gmail;
use Email::Simple::Creator;
my $email = Email::Simple->create (
header => [
From => '@gmail.com',
To => '@gmail.com',
Subject => 'Make it simple',
],
body => 'buddy I got it ...',
);
my $sender = Email::Send->new
({
mailer => 'Gmail',
mailer_args =>
[
username => '',
password => '',
]
});
$sender->send ($email);