ofcourse, i replaced the internet address to valid address :)





From: [EMAIL PROTECTED]
To: perl-win32-users@listserv.activestate.com
Subject: Newbie: email from perl script
Date: Fri, 3 Nov 2006 15:43:06 -0500

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.

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]");
                        $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.

Thanks
khozaima


Try the next generation of search with Windows LiveT Search today! Try it now!


Try the next generation of search with Windows LiveT Search today! Try it!
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to