Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

Question

Problem with Email::Send::Gmail

Nov 7, 2013 1:31AM PST

Hi,
I am using the following code. I am using windows 7 and i ahve active perl and mchine is i5. I got it from web site.

<span id="INSERTION_MARKER">#!/usr/bin/perl ##use strict; use warnings; use Email::Send; use Email::Send::Gmail; use Email::Simple::Creator;use IO::Socket::SSL qw( SSL_VERIFY_NONE );our ($uri);RPC:LoveML::Client->new($uri, useragent => [ ssl_opts => { verify_hostname => 0, SSL_verify_mode => SSL_VERIFY_NONE, }, ],); my $email = Email::Simple->create( header => [ From => 'zulfi60001@gmail.com', To => 'zulfi60001@gmail.com', Subject => 'Server down', ], body => 'The server is down. Start panicing.', ); my $sender = Email::Send->new( { mailer => 'Gmail', mailer_args => [ username => 'zulfi60001@gmail.com', password => 'sand144rama', ] } ); eval { $sender->send($email) }; die "Error sending email: $@" if $@;

Its giving me following error:

D:\Zulfi\PERL MAIN FOLDER>perl gmail2.pl
Can't locate object method "new" via package "RPC:LoveML::Client" (perhaps you for
got to load "RPC:LoveML::Client"?) at gmail2.pl line 10.

D:\Zulfi\PERL MAIN FOLDER>

Can somebody help me with this problem.

Zulfi.

Discussion is locked

- Collapse -
Answer
Why Crosspost ?
Nov 7, 2013 1:36AM PST

it just confuses the issue....Digger

- Collapse -
Answer
Sorry no.
Nov 7, 2013 1:39AM PST
- Collapse -
Another example Tried
Nov 7, 2013 2:28AM PST

Hi,
I have tried another example. Its giving me the same error which i got from first post:
My code is:
use Net::SMTP::TLS;
my $mailer = new Net::SMTP::TLS(
'smtp.gmail.com',
Hello => 'smtp.gmail.com',
Port => 587,
User => 'username',
Password=> 'password');
$mailer->mail('from@domain.com');
$mailer->to('to@domain.com');
$mailer->data;
$mailer->datasend("Sent from perl!");
$mailer->dataend;
$mailer->quit;


I am getting the following error:

D:\Zulfi\PERL MAIN FOLDER>perl gmail3.pl
*******************************************************************
Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client
is deprecated! Please set SSL_verify_mode to SSL_VERIFY_PEER
together with SSL_ca_file|SSL_ca_path for verification.
If you really don't want to verify the certificate and keep the
connection open to Man-In-The-Middle attacks please set
SSL_verify_mode explicitly to SSL_VERIFY_NONE in your application.
*******************************************************************
at C:/Perl64/site/lib/Net/SMTP/TLS.pm line 181.
invalid SSL_version specified at C:/Perl64/lib/IO/Socket/SSL.pm line 389.

D:\Zulfi\PERL MAIN FOLDER>

Kindly guide me how to remove the above error.

Zulfi.

- Collapse -
Sorry no
Nov 7, 2013 2:37AM PST
- Collapse -
cant load "RPC::XML::Client"?
Nov 7, 2013 4:23PM PST

#!/usr/bin/perl
use strict;
use warnings;
use Email::Send;
use Email::Send::Gmail;
use Email::Simple::Creator;
use RPC:LoveML::Server;
use RPC:LoveML::Client;






use IO::Socket::SSL qw( SSL_VERIFY_NONE );
our ($uri);

$cli=RPC:LoveML::Client->new($uri,
useragent => [
ssl_opts => {
verify_hostname => 0,
SSL_verify_mode => SSL_VERIFY_NONE,
},
],
);

my $email = Email::Simple->create(
header => [
From => 'zulfi60001@gmail.com',
To => 'zulfi60001@gmail.com',
Subject => 'Server down',
],
body => 'The server is down. Start panicing.',
);

my $sender = Email::Send->new(
{ mailer => 'Gmail',
mailer_args => [
username => 'zulfi60001@gmail.com',
password => 'xxx',
]
}
);
eval { $sender->send($email) };
die "Error sending email: $@" if $@;

Hi,

I have done lot of research but i cant find how to load the client?? Kindly guide me:

I am getting following error:
D:\Zulfi\PERL MAIN FOLDER>perl gmail2.pl
Can't locate object method "new" via package "RPC:LoveML::Client" (perhaps you for
got to load "RPC:LoveML::Client"?) at gmail2.pl line 10.

D:\Zulfi\PERL MAIN FOLDER>

- Collapse -
Altered code but still getting compilation errors
Nov 7, 2013 11:17PM PST

Hi,

I have changed the code but i am still getting error:
#!/usr/bin/perl
use strict;
use warnings;
use Email::Send;
use Email::Send::Gmail;
use Email::Simple::Creator;
use RPC:LoveML::Server;
use RPC:LoveML::Client;






use IO::Socket::SSL qw( SSL_VERIFY_NONE );
our ($uri);

$cli=RPC:LoveML::Client->new($uri,
useragent => [
ssl_opts => {
verify_hostname => 0,
SSL_verify_mode => SSL_VERIFY_NONE,
},
],
);

my $email = Email::Simple->create(
header => [
From => 'zulfi60001@gmail.com',
To => 'zulfi60001@gmail.com',
Subject => 'Server down',
],
body => 'The server is down. Start panicing.',
);

my $sender = Email::Send->new(
{ mailer => 'Gmail',
mailer_args => [
username => 'zulfi60001@gmail.com',
password => 'xxx',
]
}
);
eval { $sender->send($email) };
die "Error sending email: $@" if $@;

The error is:
D:\Zulfi\PERL MAIN FOLDER>perl gmail2_test.pl
Global symbol "$cli" requires explicit package name at gmail2_test.pl line 19.
Execution of gmail2_test.pl aborted due to compilation errors.

D:\Zulfi\PERL MAIN FOLDER>

Somebody plz guide me.

Zulfi.

- Collapse -
I got the Solution
Nov 8, 2013 1:19PM PST