Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > sending email with Net::SMTP::SSL -- help needed

Reply
Thread Tools

sending email with Net::SMTP::SSL -- help needed

 
 
Kamil
Guest
Posts: n/a
 
      09-21-2005
Hi, I am new to perl, and dont know much about CPAN and modules... What
am I doing wrong in the Net::SMTP::SSL constructor?!

This works fine:

my $smtp_port=465;
my $smtp = Net::SMTP::SSL->new(Host => "smtp.gmail.com", Port =>
$smtp_port);
die "Couldn't connect to server" unless $smtp;


But, this does NOT work:

my $smtp_port=465;
my $smtp_server="smtp.google.com";
my $smtp = Net::SMTP::SSL->new(Host => $smtp_server, Port =>
$smtp_port);
die "Couldn't connect to server" unless $smtp;


Error:

Couldn't connect to server at ./process_sweep.pl line 1298.


The documentation says:

Host - SMTP host to connect to. It may be a single scalar, as defined
for the PeerAddr option in IO::Socket::INET, or a reference to an array
with hosts to try in turn. The "host" method will return the value
which was used to connect to the host.


I have tried using:

my $smtp_port=465;
my @smtp_server;
push(@smtp_server,"smtp.google.com");
my $smtp = Net::SMTP::SSL->new(Host => \@smtp_server, Port =>
$smtp_port);
die "Couldn't connect to server" unless $smtp;


But it doesn't work either...

 
Reply With Quote
 
 
 
 
Eric Bohlman
Guest
Posts: n/a
 
      09-21-2005
"Kamil" <> wrote in news:1127286563.416133.57220
@g43g2000cwa.googlegroups.com:

> Hi, I am new to perl, and dont know much about CPAN and modules... What
> am I doing wrong in the Net::SMTP::SSL constructor?!
>
> This works fine:
>
> my $smtp_port=465;
> my $smtp = Net::SMTP::SSL->new(Host => "smtp.gmail.com", Port =>
> $smtp_port);
> die "Couldn't connect to server" unless $smtp;
>
>
> But, this does NOT work:
>
> my $smtp_port=465;
> my $smtp_server="smtp.google.com";
> my $smtp = Net::SMTP::SSL->new(Host => $smtp_server, Port =>
> $smtp_port);
> die "Couldn't connect to server" unless $smtp;
>
>
> Error:
>
> Couldn't connect to server at ./process_sweep.pl line 1298.


The most obvious thing I see is that you're trying to connect to two
different SMTP servers. Does your first attempt work if you substitute
"smtp.google.com" for "smtp.gmail.com"?
 
Reply With Quote
 
 
 
 
Kamil
Guest
Posts: n/a
 
      09-22-2005
Thanks for the suggestion Eric. It works fine now. Dunno how I missed
that... lack of sleep maybe... Thanks again.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to get the correct email format when sending email using sqldatareader rote ASP .Net 8 04-17-2008 02:14 AM
Help needed on this 857W config. Repost to be clearer what the problemsare and the help needed sparticle Cisco 3 08-30-2007 07:47 PM
problem sending mail: Sending the email to the following server failed Luke Java 2 03-15-2007 10:54 AM
pls help me when i sent mail, it vil sending twice instead of once ,am using java.mail,am sending my code.... shailajabtech@gmail.com Java 0 09-28-2006 06:38 AM
help -- sending email on the server =?Utf-8?B?dmFnem9uZQ==?= ASP .Net 5 02-04-2004 10:00 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57