in reply to Re: Strange Situation with Net::SMTP
in thread Strange Situation with Net::SMTP

Thanks for the explanation of the " " and ' ', that makes a lot more sense now.

Don't seem to be able to get the code above to work though, it just hangs for about 5 seconds, then I get this message 'Can't call method "mail" on an undefined value at mailme.pl line 6'

What does the $smtp->mail('me@foo.com'); line actually do then? Compared to the $smtp->to('me@foo.com');?

Replies are listed 'Best First'.
Re: Re: Re: Strange Situation with Net::SMTP
by pg (Canon) on Mar 25, 2003 at 22:58 UTC
    I tested it before I post, as I always do. I believe the problem is that you didn't replace the email server name and email address with real ones.

    The error you got basically means that $smtp is undef. I believe that is because you didn't change my dummy server name to your real one, so Perl can not establish the SMTP connection.
Re: Re: Re: Strange Situation with Net::SMTP
by phydeauxarff (Priest) on Mar 25, 2003 at 22:45 UTC
    Check out the docs for Net::SMTP and RFC 821 for the full answer but basically. $smtp->mail('me@foo.com'); is From:me@foo.com
    and $smtp->to('me@foo.com'); is....well To:me@foo.com