Subject: | Can't locate object method send |
Date: | Thu, 19 Dec 2013 17:24:14 -0500 |
To: | bug-Email-Send-SMTP-Gmail [...] rt.cpan.org |
From: | Sergio Banguero <s.banguero [...] gmail.com> |
I am getting this error when running the following code:
ERROR:
Could not connect to SMTP server
Can't locate object method "send" via package "-1" (perhaps you forgot to
load "
-1"?) at send_email.pl line 73.
CODE:
use strict;
use warnings;
use Email::Send::SMTP::Gmail;
my $mail=Email::Send::SMTP::Gmail->new( -smtp=>$SMTP_SERVER,
-login=>$EMAIL_FROM,
-pass=>$PASSWORD,
-layer=>$LAYER,
-port=>587);
$mail->send(-to=>$EMAIL_TO, -subject=>$EMAIL_SUBJECT,
-body=>$CCC_HEADER);
$mail->bye;
This runs OK on Windows 7 SP2 64 bit. I dont have the error (perl, v5.10.1
(*) built for MSWin32-x86-multi-thread)
When I run it on Windows Server 2008 R2 64bit it fails, it only recognizes
the *new* method, *send *or *bye *are not recognized.
I am using strawberry perl 5.18.1.1. I tried both 32 and 64 bit versions
I checked the Gmail.pm and it does have the sub for send and for mail, not
sure why is not being properly picked up.
Thanks