I have been trying to get the sample program in the ActiveState documentation to work,
but without much success. Here is the code:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
use Net::SMTP;
$smtp = Net::SMTP->new('shaw.ca'); # connect to an SMTP server
$smtp->mail( '[EMAIL PROTECTED]' ); # use the sender's address here
$smtp->to('[EMAIL PROTECTED]'); # recipient's address
$smtp->data(); # Start the mail
# 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(); # Finish sending the mail
$smtp->quit; # Close the SMTP connection
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
It kept giving me "Can't call method 'mail' on an undefined value at test1.pl line 4"
Does anyone have any idea how to fix this? Or has anyone had a successful experience
doing what I am trying to do?
Thanks.