On Thu, 6 Jun 2002 [EMAIL PROTECTED] wrote:

> 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);
>    $smtp -> to ($optTo);
>
>    $smtp -> data();
>
>    Send the Header
>
>    $smtp -> datasend ("To: [EMAIL PROTECTED]\n");
>    $smtp -> datasend ("From: [EMAIL PROTECTED]\n");
>    $smtp -> datasend ("\n");
>
>    Send the body
>
>    $smtp -> datasend("hello, world!\n");
>    $smtp -> dataend();
>    $smtp -> quit;
>
>
> It say:
>
> Can't call method "mail" on an undefined value at
> mailtest.pl line 8
>
> line 8 is:    $smtp -> mail($optFrom);
>
> I tried: $smtp -> mail('[EMAIL PROTECTED]'); it did not help.
>
> What might be wrong here?
>

Most likely your statement:

   $smtp = Net::SMTP -> new ("luxn.com");

failed. Had you checked the result you would have known.
It probably failed because luxn.com is not the name of the
host that provides mail service for the domain luxn.com.
The parameter to the new method must be a hostname, not
a domain name.

**** [EMAIL PROTECTED] <Carl Jolley>
**** All opinions are my own and not necessarily those of my employer ****

_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to