Re: Send email using SMTP

[email protected] (Fúlvio) Tue, 6 Jan 2009 04:17:12 -0800 (PST)
Newsgroups perl.beginners.cgi
Organization http://groups.google.com
Message-ID <80a7ea2d-fcc7-48e1-ba88-006b1c255b61@o11g2000yql.googlegroups.com>
Hi Jody,

I use your code bellow but the the following error message happens:

"Can't call method "domain" on an undefined value at ...."

Thanks,
Fúlvio

On 5 jan, 21:16, [email protected] (Jody Fanto) wrote:
> 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