As a side note, I copied the script to my FreeBSD box, running 5.14.4, and I
get some odd warnings, although it does actually send the email.
Connecting to smtp.gmail.com using tls with LOGIN on port 587 and timeout of
60
Net::SMTPS>>> Net::SMTPS(0.04)
Net::SMTPS>>> IO::Socket::INET6(2.69)
Net::SMTPS>>> IO::Socket(1.32)
Net::SMTPS>>> IO::Handle(1.31)
Net::SMTPS>>> Exporter(5.64_03)
Net::SMTPS>>> Net::SMTP(2.31)
Net::SMTPS>>> Net::Cmd(2.29)
Net::SMTPS>>> IO::Socket::INET(1.31)
Net::SMTPS=GLOB(0x28773578)<<< 220 smtp.gmail.com ESMTP x1sm14361875pax.7 -
gsmtp
Net::SMTPS=GLOB(0x28773578)>>> EHLO localhost.localdomain
Net::SMTPS=GLOB(0x28773578)<<< 250-smtp.gmail.com at your service,
[68.185.1.62]
Net::SMTPS=GLOB(0x28773578)<<< 250-SIZE 35882577
Net::SMTPS=GLOB(0x28773578)<<< 250-8BITMIME
Net::SMTPS=GLOB(0x28773578)<<< 250-STARTTLS
Net::SMTPS=GLOB(0x28773578)<<< 250-ENHANCEDSTATUSCODES
Net::SMTPS=GLOB(0x28773578)<<< 250-PIPELINING
Net::SMTPS=GLOB(0x28773578)<<< 250-CHUNKING
Net::SMTPS=GLOB(0x28773578)<<< 250 SMTPUTF8
Net::SMTPS=GLOB(0x28773578)>>> STARTTLS
Net::SMTPS=GLOB(0x28773578)<<< 220 2.0.0 Ready to start TLS
Use of uninitialized value $ver in string eq at
/usr/local/lib/perl5/site_perl/5.14/IO/Socket/SSL.pm line 1644, <GEN0> line
10.
Use of uninitialized value $ver in string eq at
/usr/local/lib/perl5/site_perl/5.14/IO/Socket/SSL.pm line 1644, <GEN0> line
10.
Use of uninitialized value $ver in string eq at
/usr/local/lib/perl5/site_perl/5.14/IO/Socket/SSL.pm line 1644, <GEN0> line
10.
Use of uninitialized value $ver in string eq at
/usr/local/lib/perl5/site_perl/5.14/IO/Socket/SSL.pm line 1644, <GEN0> line
10.
Use of uninitialized value $ver in string eq at
/usr/local/lib/perl5/site_perl/5.14/IO/Socket/SSL.pm line 1644, <GEN0> line
10.
Argument "" isn't numeric in bitwise and (&) at
/usr/local/lib/perl5/site_perl/5.14/IO/Socket/SSL.pm line 1664, <GEN0> line
10.
Net::SMTPS=GLOB(0x28773578)>>> EHLO localhost.localdomain
Net::SMTPS=GLOB(0x28773578)<<< 250-smtp.gmail.com at your service,
[68.185.1.62]
Net::SMTPS=GLOB(0x28773578)<<< 250-SIZE 35882577
Net::SMTPS=GLOB(0x28773578)<<< 250-8BITMIME
Net::SMTPS=GLOB(0x28773578)<<< 250-AUTH LOGIN PLAIN XOAUTH2
PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH
Net::SMTPS=GLOB(0x28773578)<<< 250-ENHANCEDSTATUSCODES
Show quoted text-----Original Message-----
From: Juan Jose San Martin via RT
[mailto:bug-Email-Send-SMTP-Gmail@rt.cpan.org]
Sent: Sunday, October 16, 2016 1:20 AM
To: mrcpu@lilpantry.com
Subject: [rt.cpan.org #118402] Bug on windows.
<URL:
https://rt.cpan.org/Ticket/Display.html?id=118402 >
Hello.
It seems to be an issue at the module IO::Socket::IP. For some reason, it's
unable to keep the connection open.
The debug trace expected is:
Connecting to smtp.gmail.com using tls with LOGIN on port 587 and timeout of
60 Net::SMTPS>>> Net::SMTPS(0.04)
Net::SMTPS>>> IO::Socket::INET6(2.72)
Net::SMTPS>>> IO::Socket(1.38)
Net::SMTPS>>> IO::Handle(1.35)
Net::SMTPS>>> Exporter(5.72)
Net::SMTPS>>> Net::SMTP(3.10)
Net::SMTPS>>> Net::Cmd(3.10)
Net::SMTPS>>> IO::Socket::IP(0.37)
Net::SMTPS=GLOB(0x1933660)<<< 220 smtp.gmail.com ESMTP a1sm40758152wjl.28 -
gsmtp Net::SMTPS=GLOB(0x1933660)>>> EHLO localhost.localdomain
Net::SMTPS=GLOB(0x1933660)<<< 250-smtp.gmail.com at your service,
[1a02:a205:2003:1951::1] ...
...
Please, if it's possible, check the next points:
1) Try to connect by telnet and completing the first steps of the protocol.
Write the next commands:
-> telnet smtp.gmail.com 587
-> EHLO smtp.gmail.com
-> STARTTLS
2) Try to debug IO::Socket::IP using the next script to open a connection
directly:
#!/usr/bin/perl
use strict;
use warnings;
use IO::Socket::IP;
my $sock = IO::Socket::IP->new(
PeerHost => "smtp.gmail.com",
PeerPort => "smtp",
Type => SOCK_STREAM,
) or die "Cannot construct socket - $@";
my $familyname = ( $sock->sockdomain == PF_INET6 ) ? "IPv6" :
( $sock->sockdomain == PF_INET ) ? "IPv4" :
"unknown";
printf "Connected to google via %s\n", $familyname;
3) Finally, try to connect from another PC to rule out network issues.
Regards,
Peco
On Sun Oct 16 01:43:53 2016, mrcpu@lilpantry.com wrote:
> Perl 5.22.0 on windows.
>
>
>
> I get the following with the example program:
>
>
>
> Connecting to smtp.gmail.com using tls with LOGIN on port 587 and
> timeout of 60
>
> Net::SMTPS>>> Net::SMTPS(0.04)
>
> Net::SMTPS>>> IO::Socket::INET6(2.72)
>
> Net::SMTPS>>> IO::Socket(1.38)
>
> Net::SMTPS>>> IO::Handle(1.35)
>
> Net::SMTPS>>> Exporter(5.72)
>
> Net::SMTPS>>> Net::SMTP(3.10)
>
> Net::SMTPS>>> Net::Cmd(3.10)
>
> Net::SMTPS>>> IO::Socket::IP(0.37)
>
> readline() on unopened filehandle GEN0 at
> C:/Strawberry/perl/site/lib/Net/Cmd.pm line 404.
>
> Could not connect to SMTP server
>
> Can't call method "send" without a package or object reference…
>
>
>
>
>
> Tried TLS, SSL, port 465, 587, 25, doesn’t get past that spot. If I
> use telnet to connect, I can connect to those ports with no problem.
>
>
>
> Haven’t figured it out, but it looks like a great little package.
>
> *--*
>
> *Jaye Mathisen*
>
> *Lil Pantry*
>
> *Ph: 541-476-0152 / Fax: 541-476-0152*
>
--
------------------------------
This electronic message may contain information that is privileged,
confidential or otherwise protected from disclosure to anyone other than
its intended recipient(s). Any dissemination or use of this electronic
message or its contents by persons other than the intended recipient(s) is
strictly prohibited, and may be unlawful. If you have received this
electronic transmission in error, please reply immediately to the sender so
that we may correct our internal records, and then delete the original
message.