Home > Archive > PERL Beginners > November 2005 > please help me on this perl program
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
please help me on this perl program
|
|
| perl_programmer 2005-11-22, 3:56 am |
| Hi folks,
In my perl program i am sending mail using the following program
use NET::SMTP;
$smtp_handle = new NET::SMTP(Host=>'mail_host' ,
Hello=>'',
Debug=>1);
$smtp_handle->to('sender_mail_id');
$smtp_handle->data();
$smtp_handle->datasend("To:myemail");
$smtp_handle->datasend("Sender:frommymail");
$smtp_handle->datasend("replyto:mymailbox");
$smtp_handle->datasend("From:sender_name");
$smtp_handle->datasend("Subject:mail testing");
$smtp_handle->datasend("\nTHis is message body");
$smtp_handle->dataend();
$smtp_handle->quit;
For the above program this is the smtp log i got from my friend
sending_pc_ip - domain_host [dd/mmm/yyyy:time -0500] "QUIT - SMTP" 240
195
sending_pc_ip - domain_host [dd/mmm/yyyy:time -0500] "EHLO -?+FQHN
SMTP" 250 332
sending_pc_ip - domain_host [dd/mmm/yyyy:time -0500]"MAIL
-?+FROM:<sender_mail_id> SMTP" 250 51
sending_pc_ip - domain_host [dd/mmm/yyyy:time -0500] "RCPT
-?+TO:<recepient_mail_id> SMTP" 250 0
sending_pc_ip - domain_host [dd/mmm/yyyy:time -0500] "QUIT
-?domain_host SMTP" 240 71
The result is mail is not sent.
1)Can u please explain the response codes in the log.i can understand
240 but what is that
240 195. I am not able to understand how to interpret 195.
2)Can u guess is there something wrong in the settings of the mail
sending pc or the smtp server settings
Please reply to this.
| |
| usenet@DavidFilmer.com 2005-11-22, 3:56 am |
| perl_programmer wrote:
> In my perl program i am sending mail using the following program
>
> use NET::SMTP;
I can't really help you with the problem you're having, but I wonder if
the approach you are using is not needlessly complicated. Have you
tried something like this (which works very well for me):
use Mail::Sendmail;
%mail = ( smtp => 'my.mail.server',
To => 'you@there.com',
From => 'me@here.com',
Subject => 'Message for you, sir',
Message => "This is a very short message"
);
sendmail(%mail) or die $Mail::Sendmail::error;
|
|
|
|
|