-
November 7th, 2013, 12:16 PM
#1
ProblemEmail::Send::Gmail; with
Hi,
I am trying to send emaiEmail::Send::Gmail;
l have got following code from web:
Code:
#!/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::XML::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 $@;
I am getting following error:
D:\Zulfi\PERL MAIN FOLDER>perl gmail2.pl
Can't locate object method "new" via package "RPC::XML::Client" (perhaps you for
got to load "RPC::XML::Client"?) at gmail2.pl line 10.
D:\Zulfi\PERL MAIN FOLDER>
Somebody plz help me.
Zulfi.
-
November 8th, 2013, 10:13 AM
#2
Re: ProblemEmail::Send::Gmail; with
Hi,
I have changed my code. The code is now:
Code:
#!/usr/bin/perl
use strict;
use warnings;
use Email::Send;
use Email::Send::Gmail;
use Email::Simple::Creator;
use RPC::XML::Server;
use RPC::XML::Client;
use IO::Socket::SSL qw( SSL_VERIFY_NONE );
our ($uri);
$cli=RPC::XML::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 $@;
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 help me with this prob.
Zulfi.
-
November 8th, 2013, 11:49 AM
#3
Re: ProblemEmail::Send::Gmail; with
Hi,
Finally I got help. I am able to send email through gmail smtp. I am putting the link
http://perlguru.com/gforum.cgi?post=...=unread#unread
Zulfi.
-
November 9th, 2013, 12:16 AM
#4
Re: ProblemEmail::Send::Gmail; with
Hi
Plz translate it into English.
Zulfi,
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|