Hi, This is regarding sending e-mail from perl script using SMTP.... my script is running fine..but i am not getting any mail which i sent from script...
following is my program.... correct me if any thing is wrong in the script..... messages with debug option attached at the end..... ----------- Script Starts ---------- sub send_mail { my ( $to, $from, $subject , @body)=@_ ; use Net::SMTP ; my $relay='xyz.ap.bdi.gte.com'; print "relay is : $relay\n"; # my $smtp=Net::SMTP->new($relay, # Mreddy => '[EMAIL PROTECTED]', # Timeout => 30, # Debug => 1) ; my $smtp=Net::SMTP->new($relay) || die " Couldnt make Connection: $!\n" if (! defined $smtp) ; $smtp->mail($from) ; $smtp->to($to); $smtp->data(); $smtp->datasend("TO: $to\n"); $smtp->datasend("From: $from\n"); $smtp->datasend("Subject: $subject \n"); $smtp->datasend ("\n" ) ; foreach (@body) { $smtp->datasend("$_ \n") ; } $smtp->dataend() ; $smtp->quit ; } # end of function @body=( "This is a TEST MESSAGE" ) ; &send_mail('[EMAIL PROTECTED]','[EMAIL PROTECTED]', "hello", @body); -------- Script Ends ------------------------ if I enable debug option in that script, i got following Mreddy is my machine name where i am running perl script =========debug mesage ================= C:\Mydat\Perl>c:\usr\bin\perl smtp.pl Net::SMTP: Net::SMTP(2.24) Net::SMTP: Net::Cmd(2.21) Net::SMTP: Exporter(5.562) Net::SMTP: IO::Socket::INET(1.25) Net::SMTP: IO::Socket(1.26) Net::SMTP: IO::Handle(1.21) Net::SMTP=GLOB(0x1aafb98)<<< 220 xyz.ap.bdi.gte.com ESMTP Server (Microso ft Exchange Internet Mail Service 5.5.2653.13) ready Net::SMTP=GLOB(0x1aafb98)>>> EHLO localhost.localdomain Net::SMTP=GLOB(0x1aafb98)<<< 250-blackberry.ap.bdi.gte.com Hello [MREDDY] Net::SMTP=GLOB(0x1aafb98)<<< 250-XEXCH50 Net::SMTP=GLOB(0x1aafb98)<<< 250-HELP Net::SMTP=GLOB(0x1aafb98)<<< 250-ETRN Net::SMTP=GLOB(0x1aafb98)<<< 250-DSN Net::SMTP=GLOB(0x1aafb98)<<< 250-SIZE 0 Net::SMTP=GLOB(0x1aafb98)<<< 250-AUTH LOGIN Net::SMTP=GLOB(0x1aafb98)<<< 250 AUTH=LOGIN SMTP is : Net::SMTP=GLOB(0x1aafb98) Net::SMTP=GLOB(0x1aafb98)>>> MAIL FROM:<[EMAIL PROTECTED]> Net::SMTP=GLOB(0x1aafb98)<<< 250 OK - mail from <[EMAIL PROTECTED]> Net::SMTP=GLOB(0x1aafb98)>>> RCPT TO:<[EMAIL PROTECTED]> Net::SMTP=GLOB(0x1aafb98)<<< 250 OK - Recipient <[EMAIL PROTECTED]> Net::SMTP=GLOB(0x1aafb98)>>> DATA Net::SMTP=GLOB(0x1aafb98)<<< 354 Send data. End with CRLF.CRLF Net::SMTP=GLOB(0x1aafb98)>>> TO: [EMAIL PROTECTED] Net::SMTP=GLOB(0x1aafb98)>>> From: [EMAIL PROTECTED] Net::SMTP=GLOB(0x1aafb98)>>> Subject: hello Net::SMTP=GLOB(0x1aafb98)>>> Net::SMTP=GLOB(0x1aafb98)>>> This is a TEST MESSAGE Net::SMTP=GLOB(0x1aafb98)>>> . Net::SMTP=GLOB(0x1aafb98)<<< 250 OK Net::SMTP=GLOB(0x1aafb98)>>> QUIT Net::SMTP=GLOB(0x1aafb98)<<< 221 closing connection ==================== __________________________________________________ Do you Yahoo!? Yahoo! Shopping - Send Flowers for Valentine's Day http://shopping.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]