khozaima shakir wrote:

> Hi All,
> I am a newbie to perl. Have installed active state and installed libnet
> module.
> 
> Am trying to learn how to send email from perl script and get follwing
> error :
> 
> Can't call method "mail" on an undefined value at myfirst.pl line 152,
> <STDIN> line 1.

Which line is 152 below ?

> the script ( off the aspn: ):
> 
> use Net::SMTP;
> 
>         use Net::SMTP;
>                         $smtp = Net::SMTP->new('here.com'); # 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]");
>                         $smtp->datasend("From: [EMAIL PROTECTED]");

The two lines above need the @ escaped (\@).

>                         $smtp->datasend("\n"); # Send the body.
>                         $smtp->datasend("Hello, World!\n");
>                         $smtp->dataend(); # Finish sending the mail
>                         $smtp->quit; # Close the SMTP connection
> 
> i can't figure out what is undefined and why is it expecting something
> from stdin.
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to