From: [EMAIL PROTECTED] > I tried the following to use SMTP to send email: > > use Net::SMTP; > $optServer = 'luxn.com'; > $optFrom = "[EMAIL PROTECTED]"; > $optTo = "[EMAIL PROTECTED]"; > $smtp = Net::SMTP -> new ("luxn.com"); > $smtp -> mail($optFrom); > ... > > It say: > > Can't call method "mail" on an undefined value at > mailtest.pl line 8 > > line 8 is: $smtp -> mail($optFrom);
>From perldoc perldiag Can't call method "%s" on an undefined value (F) You used the syntax of a method call, but the slot filled by the object reference or package name contains an undefined value. Something like this will reproduce the error: $BADREF = undef; process $BADREF 1,2,3; $BADREF->process(1,2,3); Hmm, they could have written that better. Basicaly, the $smtp you are trying to use as an object is undefined. The Net::SMTP -> new ("luxn.com"); command failed. Most probably because the "luxn.com" is not a valid mailserver address. Keep in mind that this is to be the address of the server, not the doman name. Eg. for domain krynicky.cz the mail server is amber.zine.cz (or jenda.krynicky.cz those two names point to the same IP). Jenda =========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ========== There is a reason for living. There must be. I've seen it somewhere. It's just that in the mess on my table ... and in my brain I can't find it. --- me _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs