Skip Menu |

This queue is for tickets about the Email-Send-SMTP-Gmail CPAN distribution.

Report information
The Basics
Id: 100214
Status: resolved
Priority: 0/
Queue: Email-Send-SMTP-Gmail

People
Owner: Nobody in particular
Requestors: itzik.yarhi [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.87



Subject: bug: fails to execute with undefined method "message"
Date: Sun, 9 Nov 2014 01:11:36 +0200
To: bug-Email-Send-SMTP-Gmail [...] rt.cpan.org
From: Itzik Yarhi <itzik.yarhi [...] gmail.com>
Hi. I cannot run Email::Send::SMTP::Gmail as I get the following error: Can't call method "message" on an undefined value at C:/itzik/Strawberry/perl/si te/lib/Email/Send/SMTP/Gmail.pm line 91. Please advice I am using fresh installation of Strawberry Perl 5.20. I used its CPAN tool to retrieve all packages needed. It seems that Net::SMTP was modified, obsoleting 'message' method. Please help BTW, the example code fails to run on restricted with the var '$email' not-exist. (It should be $mail var everywhere at the example) Thanks a lot --- itzik yarhi
Hi, I'm testing with the latest SMTP.pm version (2.31) without errors. Please, try the next simple code and let me know. ########### use strict; use warnings; my ($email,$error) = Email::Send::SMTP::Gmail->new(-debug=>1,verbose=>1,-smtp=>'smtp.gmail.com',-login=>'LOGIN',-pass=>'PASS'); if($email==-1){ print "Error: $error\n"; exit; } else{ print "\n\n\tBANNER: $email->banner()\n\n"; } ############### On Sat Nov 08 18:12:19 2014, itzik.yarhi@gmail.com wrote: Show quoted text
> Hi. > > I cannot run Email::Send::SMTP::Gmail as I get the following error: > Can't call method "message" on an undefined value at > C:/itzik/Strawberry/perl/si > te/lib/Email/Send/SMTP/Gmail.pm line 91. > > Please advice > > I am using fresh installation of Strawberry Perl 5.20. > I used its CPAN tool to retrieve all packages needed. > It seems that Net::SMTP was modified, obsoleting 'message' method. > > Please help > > BTW, the example code fails to run on restricted with the var '$email' > not-exist. > (It should be $mail var everywhere at the example) > > Thanks a lot > > --- > itzik yarhi
Subject: Re: [rt.cpan.org #100214] bug: fails to execute with undefined method "message"
Date: Mon, 10 Nov 2014 07:01:56 +0200
To: bug-Email-Send-SMTP-Gmail [...] rt.cpan.org
From: Itzik Yarhi <itzik.yarhi [...] gmail.com>
Hi Juan. Thanks a lot. It seems the latest of Net:SMTP is now 3.02. Here is output: C:\itzik\visitors>perl send2.pl Connecting to smtp.gmail.com using tls with LOGIN and timeout of 60 Net::SMTPS>>> Net::SMTPS(0.04) Net::SMTPS>>> IO::Socket::INET6(2.72) Net::SMTPS>>> IO::Socket(1.37) Net::SMTPS>>> IO::Handle(1.35) Net::SMTPS>>> Exporter(5.71) Net::SMTPS>>> Net::SMTP(3.02) Net::SMTPS>>> Net::Cmd(3.02) Net::SMTPS>>> IO::Socket::IP(0.32) readline() on unopened filehandle GEN0 at C:/itzik/Strawberry/perl/lib/Net/Cmd.p m line 371. Can't call method "message" on an undefined value at C:/itzik/Strawberry/perl/si te/lib/Email/Send/SMTP/Gmail.pm line 91. תודה המשך יום נעים --- itzik yarhi On Sun, Nov 9, 2014 at 11:45 AM, Juan Jose San Martin via RT < bug-Email-Send-SMTP-Gmail@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=100214 > > > Hi, > > I'm testing with the latest SMTP.pm version (2.31) without errors. > Please, try the next simple code and let me know. > > ########### > use strict; > use warnings; > > my ($email,$error) = > Email::Send::SMTP::Gmail->new(-debug=>1,verbose=>1,-smtp=>'smtp.gmail.com > ',-login=>'LOGIN',-pass=>'PASS'); > > if($email==-1){ > print "Error: $error\n"; > exit; > } > else{ > print "\n\n\tBANNER: $email->banner()\n\n"; > } > > ############### > > On Sat Nov 08 18:12:19 2014, itzik.yarhi@gmail.com wrote:
> > Hi. > > > > I cannot run Email::Send::SMTP::Gmail as I get the following error: > > Can't call method "message" on an undefined value at > > C:/itzik/Strawberry/perl/si > > te/lib/Email/Send/SMTP/Gmail.pm line 91. > > > > Please advice > > > > I am using fresh installation of Strawberry Perl 5.20. > > I used its CPAN tool to retrieve all packages needed. > > It seems that Net::SMTP was modified, obsoleting 'message' method. > > > > Please help > > > > BTW, the example code fails to run on restricted with the var '$email' > > not-exist. > > (It should be $mail var everywhere at the example) > > > > Thanks a lot > > > > --- > > itzik yarhi
> > > >
Hi, I'm unable to reproduce the issue :-/ Here is my output (see versions) Connecting to smtp.gmail.com using tls with LOGIN and timeout of 60 Net::SMTPS>>> Net::SMTPS(0.04) Net::SMTPS>>> IO::Socket::INET6(2.72) Net::SMTPS>>> IO::Socket(1.36) Net::SMTPS>>> IO::Handle(1.34) Net::SMTPS>>> Exporter(5.70) Net::SMTPS>>> Net::SMTP(3.02) Net::SMTPS>>> Net::Cmd(3.02) Net::SMTPS>>> IO::Socket::IP(0.32) Net::SMTPS=GLOB(0x2bee6c8)<<< 220 mx.google.com ESMTP ai11sm12345676wid.7 - gsmtp There are minor differences (IO::Socket, IO::Handle, Exporter) but I think the issue is related to IO::Socket, which is unable to create the socket over the network. 1) Please, check your system is able to connect to smtp.google.com on 465. Show quoted text
> telnet smtp.gmail.com 465
Trying 74.125.206.108... Connected to gmail-smtp-msa.l.google.com. Escape character is '^]'. 220 mx.google.com ESMTP t9sm22108914wjf.41 - gsmtp 2) Use another layer (see -layer=>'ssl') my ($email,$error)=Email::Send::SMTP::Gmail->new(-debug=>1,verbose=>1,-smtp=>'smtp.gmail.com',-login=>'LOGIN',-pass=>'PASS',-layer=>'ssl'); 3) Force another port (see -port=>'25') my ($email,$error)=Email::Send::SMTP::Gmail->new(-debug=>1,verbose=>1,-smtp=>'smtp.gmail.com',-login=>'LOGIN',-pass=>'PASS',-port=>'25'); Regards, Peco On Mon Nov 10 00:02:36 2014, itzik.yarhi@gmail.com wrote: Show quoted text
> Hi Juan. > > Thanks a lot. > > It seems the latest of Net:SMTP is now 3.02. > > Here is output: > > C:\itzik\visitors>perl send2.pl > Connecting to smtp.gmail.com using tls with LOGIN and timeout of 60 > Net::SMTPS>>> Net::SMTPS(0.04) > Net::SMTPS>>> IO::Socket::INET6(2.72) > Net::SMTPS>>> IO::Socket(1.37) > Net::SMTPS>>> IO::Handle(1.35) > Net::SMTPS>>> Exporter(5.71) > Net::SMTPS>>> Net::SMTP(3.02) > Net::SMTPS>>> Net::Cmd(3.02) > Net::SMTPS>>> IO::Socket::IP(0.32) > readline() on unopened filehandle GEN0 at > C:/itzik/Strawberry/perl/lib/Net/Cmd.p > m line 371. > Can't call method "message" on an undefined value at > C:/itzik/Strawberry/perl/si > te/lib/Email/Send/SMTP/Gmail.pm line 91. > > > > תודה > > המשך יום נעים > > --- > itzik yarhi > > On Sun, Nov 9, 2014 at 11:45 AM, Juan Jose San Martin via RT < > bug-Email-Send-SMTP-Gmail@rt.cpan.org> wrote: >
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=100214 > > > > > Hi, > > > > I'm testing with the latest SMTP.pm version (2.31) without errors. > > Please, try the next simple code and let me know. > > > > ########### > > use strict; > > use warnings; > > > > my ($email,$error) = > > Email::Send::SMTP::Gmail->new(-debug=>1,verbose=>1,-smtp=>'smtp.gmail.com > > ',-login=>'LOGIN',-pass=>'PASS'); > > > > if($email==-1){ > > print "Error: $error\n"; > > exit; > > } > > else{ > > print "\n\n\tBANNER: $email->banner()\n\n"; > > } > > > > ############### > > > > On Sat Nov 08 18:12:19 2014, itzik.yarhi@gmail.com wrote:
> > > Hi. > > > > > > I cannot run Email::Send::SMTP::Gmail as I get the following error: > > > Can't call method "message" on an undefined value at > > > C:/itzik/Strawberry/perl/si > > > te/lib/Email/Send/SMTP/Gmail.pm line 91. > > > > > > Please advice > > > > > > I am using fresh installation of Strawberry Perl 5.20. > > > I used its CPAN tool to retrieve all packages needed. > > > It seems that Net::SMTP was modified, obsoleting 'message' method. > > > > > > Please help > > > > > > BTW, the example code fails to run on restricted with the var '$email' > > > not-exist. > > > (It should be $mail var everywhere at the example) > > > > > > Thanks a lot > > > > > > --- > > > itzik yarhi
> > > > > > > >
Subject: [rt.cpan.org #100214]
Date: Tue, 11 Nov 2014 09:39:41 -0000
To: <bug-Email-Send-SMTP-Gmail [...] rt.cpan.org>
From: "David Richards" <drichards [...] jetbadger.co.uk>
Hi, I am using v0.87 and this bug is still there. It happens when connection to SMTPS fails. The problem is in the part of Gmail.pm below, shown with my changes. In the original code, line 90 is only reached if "not $self->{sender}", line 90 then tries to use $self->{sender} as an object with a method "message()". 85 else{ 86 my $sec=undef; 87 if($layer eq 'tls'){$sec='starttls';} 88 elsif($layer eq 'ssl'){$sec='ssl';} 89 if (not $self->{sender} = Net::SMTPS->new($smtp, Port =>$port, doSSL=>$sec, Debug=>$debug, SSL_verify_mode=>$ssl_mode, SSL_ca_file=>$ssl_ca,SSL_ca_path=>$ssl_path, Timeout=>$timeout)){ 90 # my $error_string=$self->{sender}->message(); 91 # chomp $error_string; 92 $self->{error}=$!; 93 print "Could not connect to SMTP server\n" if $debug; 94 return $self; 95 #return -1; 96 } 97 } My application code then checks the object returned by the new() method, so # Connect to the SMTP (SSL) server my $mail = Email::Send::SMTP::Gmail->new( -smtp=>$smtpserver, -login=>$smtpuser, -pass=>$smtppassword, -from=>$from, -ssl_verify_mode => Net::SSLeay::VERIFY_NONE(), -debug => 1 ); unless( ref($mail) ) { print "SMTP Connection error: $mail\n"; } else { ... I hope that this is helpful. Dave Richards
Catched. Thank you David. New release 0.88 recently uploaded to CPAN. Peco On Tue Nov 11 04:40:12 2014, drichards@jetbadger.co.uk wrote: Show quoted text
> Hi, > I am using v0.87 and this bug is still there. It happens when connection to > SMTPS fails. > The problem is in the part of Gmail.pm below, shown with my changes. > In the original code, line 90 is only reached if "not $self->{sender}", line > 90 then tries to use $self->{sender} as an object with a method "message()". > > 85 else{ > 86 my $sec=undef; > 87 if($layer eq 'tls'){$sec='starttls';} > 88 elsif($layer eq 'ssl'){$sec='ssl';} > 89 if (not $self->{sender} = Net::SMTPS->new($smtp, Port =>$port, > doSSL=>$sec, Debug=>$debug, SSL_verify_mode=>$ssl_mode, > SSL_ca_file=>$ssl_ca,SSL_ca_path=>$ssl_path, Timeout=>$timeout)){ > 90 # my $error_string=$self->{sender}->message(); > 91 # chomp $error_string; > 92 $self->{error}=$!; > 93 print "Could not connect to SMTP server\n" if $debug; > 94 return $self; > 95 #return -1; > 96 } > 97 } > > My application code then checks the object returned by the new() method, so > > # Connect to the SMTP (SSL) server > my $mail = Email::Send::SMTP::Gmail->new( > -smtp=>$smtpserver, > -login=>$smtpuser, > -pass=>$smtppassword, > -from=>$from, > -ssl_verify_mode => Net::SSLeay::VERIFY_NONE(), > -debug => 1 ); > > unless( ref($mail) ) > { > print "SMTP Connection error: $mail\n"; > } > else > { > ... > > I hope that this is helpful. > Dave Richards > >
Subject: Re: [rt.cpan.org #100214] bug: fails to execute with undefined method "message"
Date: Fri, 14 Nov 2014 21:06:21 +0200
To: bug-Email-Send-SMTP-Gmail [...] rt.cpan.org
From: Itzik Yarhi <itzik.yarhi [...] gmail.com>
Dear Juan. I finally solved the issue. I modified SMTPS.pm file, removing INET6 support: #eval { # require IO::Socket::INET6 # and unshift @ISA, 'IO::Socket::INET6'; #} or do { require IO::Socket::INET and unshift @ISA, 'IO::Socket::INET'; #}; It works for me now. Muchisimas gracias Please, continue your great work. itzik תודה המשך יום נעים --- itzik yarhi On Tue, Nov 11, 2014 at 12:48 PM, Juan Jose San Martin via RT < bug-Email-Send-SMTP-Gmail@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=100214 > > > Catched. Thank you David. > > New release 0.88 recently uploaded to CPAN. > > Peco > > On Tue Nov 11 04:40:12 2014, drichards@jetbadger.co.uk wrote:
> > Hi, > > I am using v0.87 and this bug is still there. It happens when connection
> to
> > SMTPS fails. > > The problem is in the part of Gmail.pm below, shown with my changes. > > In the original code, line 90 is only reached if "not $self->{sender}",
> line
> > 90 then tries to use $self->{sender} as an object with a method
> "message()".
> > > > 85 else{ > > 86 my $sec=undef; > > 87 if($layer eq 'tls'){$sec='starttls';} > > 88 elsif($layer eq 'ssl'){$sec='ssl';} > > 89 if (not $self->{sender} = Net::SMTPS->new($smtp, Port =>$port, > > doSSL=>$sec, Debug=>$debug, SSL_verify_mode=>$ssl_mode, > > SSL_ca_file=>$ssl_ca,SSL_ca_path=>$ssl_path, Timeout=>$timeout)){ > > 90 # my $error_string=$self->{sender}->message(); > > 91 # chomp $error_string; > > 92 $self->{error}=$!; > > 93 print "Could not connect to SMTP server\n" if $debug; > > 94 return $self; > > 95 #return -1; > > 96 } > > 97 } > > > > My application code then checks the object returned by the new() method,
> so
> > > > # Connect to the SMTP (SSL) server > > my $mail = Email::Send::SMTP::Gmail->new( > > -smtp=>$smtpserver, > > -login=>$smtpuser, > > -pass=>$smtppassword, > > -from=>$from, > > -ssl_verify_mode => Net::SSLeay::VERIFY_NONE(), > > -debug => 1 ); > > > > unless( ref($mail) ) > > { > > print "SMTP Connection error: $mail\n"; > > } > > else > > { > > ... > > > > I hope that this is helpful. > > Dave Richards > > > >
> > > >
On Fri Nov 14 14:07:03 2014, itzik.yarhi@gmail.com wrote: Show quoted text
> Dear Juan. > > I finally solved the issue. > > I modified SMTPS.pm file, removing INET6 support: > > #eval { > # require IO::Socket::INET6 > # and unshift @ISA, 'IO::Socket::INET6'; > #} or do { > require IO::Socket::INET > and unshift @ISA, 'IO::Socket::INET'; > #}; > > It works for me now. > > Muchisimas gracias > > Please, continue your great work. > > itzik > > > > > תודה > > המשך יום נעים > > --- > itzik yarhi > > On Tue, Nov 11, 2014 at 12:48 PM, Juan Jose San Martin via RT < > bug-Email-Send-SMTP-Gmail@rt.cpan.org> wrote: >
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=100214 > > > > > Catched. Thank you David. > > > > New release 0.88 recently uploaded to CPAN. > > > > Peco > > > > On Tue Nov 11 04:40:12 2014, drichards@jetbadger.co.uk wrote:
> > > Hi, > > > I am using v0.87 and this bug is still there. It happens when connection
> > to
> > > SMTPS fails. > > > The problem is in the part of Gmail.pm below, shown with my changes. > > > In the original code, line 90 is only reached if "not $self->{sender}",
> > line
> > > 90 then tries to use $self->{sender} as an object with a method
> > "message()".
> > > > > > 85 else{ > > > 86 my $sec=undef; > > > 87 if($layer eq 'tls'){$sec='starttls';} > > > 88 elsif($layer eq 'ssl'){$sec='ssl';} > > > 89 if (not $self->{sender} = Net::SMTPS->new($smtp, Port =>$port, > > > doSSL=>$sec, Debug=>$debug, SSL_verify_mode=>$ssl_mode, > > > SSL_ca_file=>$ssl_ca,SSL_ca_path=>$ssl_path, Timeout=>$timeout)){ > > > 90 # my $error_string=$self->{sender}->message(); > > > 91 # chomp $error_string; > > > 92 $self->{error}=$!; > > > 93 print "Could not connect to SMTP server\n" if $debug; > > > 94 return $self; > > > 95 #return -1; > > > 96 } > > > 97 } > > > > > > My application code then checks the object returned by the new() method,
> > so
> > > > > > # Connect to the SMTP (SSL) server > > > my $mail = Email::Send::SMTP::Gmail->new( > > > -smtp=>$smtpserver, > > > -login=>$smtpuser, > > > -pass=>$smtppassword, > > > -from=>$from, > > > -ssl_verify_mode => Net::SSLeay::VERIFY_NONE(), > > > -debug => 1 ); > > > > > > unless( ref($mail) ) > > > { > > > print "SMTP Connection error: $mail\n"; > > > } > > > else > > > { > > > ... > > > > > > I hope that this is helpful. > > > Dave Richards > > > > > >
> > > > > > > >