Hi Rob, Thanks for your answer. I change the code to try debug and put the correct SMTP address:
$smtp_test = Net::SMTP->new('smtp.mail.yahoo.com', Timeout => 30, Debug => 1,)|| print "ERROR creating SMTP obj: $! \n"; but the following message is displayed: "Bad file descriptor". I don't need to use the SMTP procotol, I need only send an email. Thanks, Fúlvio On Mon, Jan 5, 2009 at 7:47 PM, Rob Dixon <rob.di...@gmx.com> wrote: > Fúlvio wrote: > > > > 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? > > The documentation for Net::SMTP says this > > > This documentation assumes that you are familiar with the concepts of the > > SMTP protocol described in RFC821 > > and it is important to understand that what you are trying to do isn't > trivial. > > If, however, you are au fait with SMTP then I suggest you will get better > results using the correct SMTP address 'smtp.mail.yahoo.com'. > > HTH, > > Rob >