Re: Send email using SMTP

[email protected] (Jody Fanto) Mon, 5 Jan 2009 16:16:43 -0800 (PST)
Newsgroups perl.beginners.cgi
Message-ID <[email protected]>
The problem is that you are using an invalid smtp server address.  You probably want "smtp.mail.yahoo.com".  For example, this works for me --

#!perl                                                                          
use strict;
use warnings;

use Net::SMTP;

my $smtp = Net::SMTP->new("smtp.mail.yahoo.com", Timeout => 5);
print "Domain is: " . $smtp->domain() . "\n";


--Jody






----- Original Message ----
> To: [email protected]
> 
> Hi all,
> 
> I am trying to send an email using the following code:
> 
> use Net::SMTP;
> 
> $smtp = Net::SMTP->new("smtp.yahoo.com");
> $smtp->mail('fulviocg');
> 
> but the error below is happening:
> 
> Can't call method "mail" on an undefined value at ....
> 
> Can someone help me?
> 
> Thanks
> 
> FĂșlvio