cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
New

Error sending email through GMail with perl and Email::Send::SMTP::Gmail

I am having trouble getting this to work.

The error reported from new() is

Net:Smiley FrustratedMTP: connect: Connection refused

Yes, my address and password are correct, though they are not shown here.

Am I doing anything obviously wrong?

Or does anybody have a sample perl script using Email:Smiley Frustratedend:Smiley FrustratedMTP::Gmail?

 

Thanks in advance for any help.

 

#!/usr/bin/perl -w

select(STDOUT); $| = 1; # don't block output

print "Content-type: text/html; charset=iso-8859-1\n\n";

print "<H4>Sending...</H4>\n";

use cPanelUserConfig; # for GoDaddy hosting
use strict;
use warnings;

use Email:Smiley Frustratedend:Smiley FrustratedMTP::Gmail;

my ($mail,$error)=Email:Smiley Frustratedend:Smiley FrustratedMTP::Gmail->new( -smtp=>'smtp.gmail.com',
-login=>'me@gmail.com',
-pass=>'mypass');

# print "session error: $error" unless ($email!=-1);
print $error;

# $mail->send(-to=>'rex@rexswain.com', -subject=>'Testing Email', -body=>'This is a test.');

# $mail->bye;

print "<H4>Sent</H4>\n";

exit;

3 REPLIES 3

Re: Error sending email through GMail with perl and Email::Send::SMTP::Gmail

Hi .
Could you solve it?

New

Re: Error sending email through GMail with perl and Email::Send::SMTP::Gmail

No, I never found a solution.

Re: Error sending email through GMail with perl and Email::Send::SMTP::Gmail

I'm so sorry. Thank you