Thank you Peco for the prompt reply. The error is below. Pinging
smtp.gmail.com works:
Connecting to smtp.gmail.com using tls with LOGIN on port 25 and timeout
of 60
Could not connect to SMTP server
Can't locate object method "send" via package "-1" (perhaps you forgot
to load "-1"?) at C:\Temp\email-test\e3.pl line 13.
session error: Invalid argument
C:\Temp\email-test>ping smtp.gmail.com
Pinging gmail-smtp-msa.l.google.com [74.125.200.108] with 32 bytes of data:
Reply from 74.125.200.108: bytes=32 time=93ms TTL=40
Reply from 74.125.200.108: bytes=32 time=90ms TTL=40
Windows 10, ActiveState Perl 5.24 - both 64 bit. The script is now:
use strict;
use warnings;
use Email::Send::SMTP::Gmail;
my ($mail,$error)=Email::Send::SMTP::Gmail->new( -smtp=>'smtp.gmail.com',
-login=>'amagdum@identlogic.com',
-pass=>'XXX',
-debug=>'1');
print "session error: $error" unless ($mail!=-1);
$mail->send(-to=>'sanjay@banerji.in', -subject=>'Hello!', -body=>'Just
testing it');
$mail->bye;
Regards
Sanjay
On 19/07/2018 17:29, Juan Jose San Martin via RT wrote:
Show quoted text> <URL:
https://rt.cpan.org/Ticket/Display.html?id=125887 >
>
> Hello,
>
> It seems that you are missing some library o dependency.
>
> Please, activate the Debug option so get more information.
>
> my ($mail,$error)=Email::Send::SMTP::Gmail->new( -smtp=>'smtp.gmail.com',
> -login=>'amagdum@identlogic.com',
> -pass=>'XXX',
> -debug=>'1');
>
> Thanks,
> Peco
>
> On Thu Jul 19 07:07:15 2018,sanjay@banerji.in wrote:
>> Get error:
>>
>> Can't locate object method "send" via package "-1" (perhaps you forgot
>> to load "-1"?) at C:\Temp\email-test\e3.pl line 12.
>> session error: Invalid argument
>>
>> Line 12 in red below.
>>
>> Windows 10 environment.
>>
>> Script as in documentation with email and password changes and
>> attachment removed:
>>
>> use strict;
>> use warnings;
>>
>> use Email::Send::SMTP::Gmail;
>>
>> my ($mail,$error)=Email::Send::SMTP::Gmail->new( -smtp=>'smtp.gmail.com',
>> -login=>'amagdum@identlogic.com',
>> -pass=>'XXX');
>>
>> print "session error: $error" unless ($mail!=-1);
>>
>> $mail->send(-to=>'sanjay@banerji.in', -subject=>'Hello!', -body=>'Just
>> testing it');
>>
>> $mail->bye;
>>
>> Both sender & receiver are google hosted emails.
>>
>>
>