Please help me on the following perl program
Please help me on the following perl program
am 22.11.2005 05:41:31 von perl_programmer_sow
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: SMTP" 250 51
sending_pc_ip - domain_host [dd/mmm/yyyy:time -0500] "RCPT
-?+TO: 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.
Re: Please help me on the following perl program
am 22.11.2005 07:16:34 von Tim Hammerquist
perl_programmer_sow wrote:
> In my perl program i am sending mail using the following program
No you're not.
> use NET::SMTP;
$ echo "use NET::SMTP;" | perl
Can't locate NET/SMTP.pm in @INC (@INC contains:
/usr/local/lib/perl5/site_perl/5.8.7/mach
/usr/local/lib/perl5/site_perl/5.8.7
/usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.8.7/BSDPAN
/usr/local/lib/perl5/5.8.7/mach /usr/local/lib/perl5/5.8.7 .) at
- line 1.
BEGIN failed--compilation aborted at - line 1.
Huh. Either you're using Windows or... see below.
> $smtp_handle = new NET::SMTP(Host=>'mail_host' ,
> Hello=>'',
> Debug=>1);
Does that really compile? Even if your filesystem is
case-insensitive, perl isn't. And why couldn't you post real
code?
> $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;
You didn't read the documentation for Net::SMTP.
> 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: SMTP" 250 51
> sending_pc_ip - domain_host [dd/mmm/yyyy:time -0500] "RCPT
> -?+TO: SMTP" 250 0
> sending_pc_ip - domain_host [dd/mmm/yyyy:time -0500] "QUIT
> -?domain_host SMTP" 240 71
Again, are your friend's SMTP logs so sensitive that you
couldn't post real output? Maybe change the hostname, but your
log output isn't even formatted consistently.
> 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.
That would be a question to ask of the smtp server's
documentation. Not Perl.
> 2)Can u guess is there something wrong in the settings of the
> mail sending pc or the smtp server settings
We've already seen "something wrong" in the Perl code attempting
to send the mail. Post real code. Post more details about your
setup. OS of the sending machine. SMTP server and version
being used.
> Please reply to this.
Ok. But now you've used all your favors.
Tim
Re: Please help me on the following perl program
am 22.11.2005 13:20:18 von perl_programmer
Hi Tim Hammerquist,
Thanks for the quick reply.I will get back to you with more information
BYE
Re: Please help me on the following perl program
am 01.12.2005 10:29:55 von perl_programmer
Hi Tim,
I am back now.
Yes I am executing this on a windows desktop.
I can swear that i am able to execute this program. I am on a exchange
server . I can send mail for myself
Beleive me i did receive mail with this program.
>You didn't read the documentation for Net::SMTP
I did not quite understand your comment. Can you explain what that
comments mean. If possible give me links where i can find the
documentation for NET::SMTP. Otherwise try to explain it to me in your
reply.
>Again, are your friend's SMTP logs so sensitive that you
>couldn't post real output? Maybe change the hostname, but your
>log output isn't even formatted consistently.
Yes they are sensitive. But sorry for the wrong formatting i should
have attached as a file rather than copy paste. But i guess you
understood the logs.
>We've already seen "something wrong" in the Perl code attempting
to send the mail. Post real code. Post more details about your
setup. OS of the sending machine. SMTP server and version
being used.
but i do not see anything wrong with the execution. The real problem is
while executing on the friends machine. He is also on exchange server
and version i do not know(is it mandatory to know the version before
isolating the problem?). Windows OS.
The real problem is
it could send the EHLO 250 , MAIL 250 ,RCPT 250 well.
But my program is sending QUIT - 240.
I can understand that the 250 is success. but why program is sending
QUIT without sending DATA packets.
Help me this time also
Thanks a ton
perl_programmer
Re: Please help me on the following perl program
am 05.12.2005 07:04:51 von Tim Hammerquist
perl_programmer wrote:
> Yes I am executing this on a windows desktop.
> I can swear that i am able to execute this program. I am on a exchange
> server . I can send mail for myself
> Beleive me i did receive mail with this program.
And I can swear that the code you posted will not even compile
with my perl installation, and that most other people in this
group (i.e., all those who aren't running your borken,
case-insensitive version of perl) will have the same problem.
> > You didn't read the documentation for Net::SMTP
> I did not quite understand your comment. Can you explain what
> that comments mean. If possible give me links where i can find
> the documentation for NET::SMTP. Otherwise try to explain it
> to me in your reply.
I told you where to find it. The documentation for Net::SMTP.
It was installed with your perl distribution (even ActivePerl),
and is also available through the perldoc site, and even Google.
You may be disappointed, however, as there is no NET::SMTP
module.
> > We've already seen "something wrong" in the Perl code
> > attempting to send the mail. Post real code. Post more
> > details about your setup. OS of the sending machine. SMTP
> > server and version being used.
>
> but i do not see anything wrong with the execution. The real problem is
> while executing on the friends machine. He is also on exchange server
> and version i do not know(is it mandatory to know the version before
> isolating the problem?). Windows OS.
But you still have not posted any code which will compile.
Tim Hammerquist