Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Problem with SMPT mail

Reply
Thread Tools

Problem with SMPT mail

 
 
L. Stern
Guest
Posts: n/a
 
      06-07-2006
Hello

I am installing Bugzilla 2.22 on a Windows 2000 and I have some problem to
configure the mail notification.
In fact no email are sent. My problem is on the use of perl script to send
email.

I have made some simple Perl script (either via Mailer or directly via SMTP)
and it seems OK for me (no error), but no email are sent.

The scripts and logs are below

Exemple 1

Script1

use Mail::Mailer;

$mailer = new Mail::Mailer('smtp', Server => "10.135.1.3",Debug => 2);
#$mailer = new Mail::Mailer 'testfile', Server => "10.135.1.3";

$mailer->open({From => '(E-Mail Removed)',
To => '(E-Mail Removed)',
Subject => "test 1234",})
or die "Can't open: $!\n";
print $mailer "Ceci est le texte";
$mailer->close();

Trace1

Net::SMTP>>> Net::SMTP(2.29)
Net::SMTP>>> Net::Cmd(2.26)
Net::SMTP>>> Exporter(5.5
Net::SMTP>>> IO::Socket::INET(1.29)
Net::SMTP>>> IO::Socket(1.29)
Net::SMTP>>> IO::Handle(1.25)
Net::SMTP=GLOB(0x1a4ed4<<< 220 KIX001 ESMTP Service (Lotus Domino Release
5.0.11) ready at Tue, 30 May 2006 14:25:55 +0200
Net::SMTP=GLOB(0x1a4ed4>>> EHLO localhost.localdomain
Net::SMTP=GLOB(0x1a4ed4<<< 250-KIX001 Hello localhost.localdomain
([136.0.1.0]), pleased to meet you
Net::SMTP=GLOB(0x1a4ed4<<< 250-HELP
Net::SMTP=GLOB(0x1a4ed4<<< 250-SIZE 51200000
Net::SMTP=GLOB(0x1a4ed4<<< 250 PIPELINING
Net::SMTP=GLOB(0x1a4ed4>>> MAIL FROM:<(E-Mail Removed)>
Net::SMTP=GLOB(0x1a4ed4<<< 250 http://www.velocityreviews.com/forums/(E-Mail Removed)...
Sender OK
Net::SMTP=GLOB(0x1a4ed4>>> RCPT TO:<(E-Mail Removed)>
Net::SMTP=GLOB(0x1a4ed4<<< 250 (E-Mail Removed)... Recipient OK
Net::SMTP=GLOB(0x1a4ed4>>> DATA
Net::SMTP=GLOB(0x1a4ed4<<< 354 Enter message, end with "." on a line by
itself
Net::SMTP=GLOB(0x1a4ed4>>> Subject: test 1234
Net::SMTP=GLOB(0x1a4ed4>>> X-Mailer: Mail::Mailer[v1.67] Net::SMTP[v2.29]
Net::SMTP=GLOB(0x1a4ed4>>> To: (E-Mail Removed)
Net::SMTP=GLOB(0x1a4ed4>>> From: (E-Mail Removed)
Net::SMTP=GLOB(0x1a4ed4>>> Ceci est le texte
Net::SMTP=GLOB(0x1a4ed4>>> .
Net::SMTP=GLOB(0x1a4ed4<<< 250 Message accepted for delivery
Net::SMTP=GLOB(0x1a4ed4>>> QUIT
Net::SMTP=GLOB(0x1a4ed4<<< 221 KIX001 SMTP Service closing transmission
channel


Exemple 2

Script 2

use Net::SMTP;
my $smtp = Net::SMTP->new('10.135.1.3', Timeout => 30, Debug => 2, ); #
connect to SMTP server
$smtp->auth;
$smtp->mail('(E-Mail Removed)');# use the sender's adress here
$smtp->to('(E-Mail Removed)'); #recipient's address
$smtp->data(); # Start the mail
$smtp->datasend('test');
$smtp->dataend(); # Finish sending the mail
$smtp->quit; # Close the SMTP connection
exit;

Trace2

Net::SMTP>>> Net::SMTP(2.29)
Net::SMTP>>> Net::Cmd(2.26)
Net::SMTP>>> Exporter(5.5
Net::SMTP>>> IO::Socket::INET(1.29)
Net::SMTP>>> IO::Socket(1.29)
Net::SMTP>>> IO::Handle(1.25)
Net::SMTP=GLOB(0x1c29bd<<< 220 KIX001 ESMTP Service (Lotus Domino Release
5.0.11) ready at Tue, 6Jun 2006 15:04:11 +0200
Net::SMTP=GLOB(0x1c29bd>>> EHLO localhost.localdomain
Net::SMTP=GLOB(0x1c29bd<<< 250-KIX001 Hello localhost.localdomain
([136.0.1.0]), pleased to meet you
Net::SMTP=GLOB(0x1c29bd<<< 250-HELP
Net::SMTP=GLOB(0x1c29bd<<< 250-SIZE 51200000
Net::SMTP=GLOB(0x1c29bd<<< 250 PIPELINING
Net::SMTP=GLOB(0x1c29bd>>> MAIL FROM:<(E-Mail Removed)>
Net::SMTP=GLOB(0x1c29bd<<< 250 (E-Mail Removed)... Sender OK
Net::SMTP=GLOB(0x1c29bd>>> RCPT TO:<(E-Mail Removed)>
Net::SMTP=GLOB(0x1c29bd<<< 250 (E-Mail Removed)... Recipient OK
Net::SMTP=GLOB(0x1c29bd>>> DATA
Net::SMTP=GLOB(0x1c29bd<<< 354 Enter message, end with "." on a line by
itself
Net::SMTP=GLOB(0x1c29bd>>> test
Net::SMTP=GLOB(0x1c29bd>>> .
Net::SMTP=GLOB(0x1c29bd<<< 250 Message accepted for delivery
Net::SMTP=GLOB(0x1c29bd>>> QUIT
Net::SMTP=GLOB(0x1c29bd<<< 221 KIX001 SMTP Service closing transmission
channel


Thanks in advance for any help on my problem.

Regards
Laurent STERN





 
Reply With Quote
 
 
 
 
Brian McCauley
Guest
Posts: n/a
 
      06-07-2006

L. Stern wrote:
> Hello
>
> I am installing Bugzilla 2.22 on a Windows 2000 and I have some problem to
> configure the mail notification.
> In fact no email are sent. My problem is on the use of perl script to send
> email.


How have you concluded that?

> I have made some simple Perl script (either via Mailer or directly via SMTP)
> and it seems OK for me (no error), but no email are sent.


If you connect to the SMTP by hand using a telnet client (e.g. PuTTY or
HyperTerminal) and send mail that way does it work?

Are there any error in the mailer's log?

Are errors being sent to the return path address
<(E-Mail Removed)>?

Have you tried sending a test mail (by another mechanism) to
<(E-Mail Removed)> to make sure that it is working?

 
Reply With Quote
 
 
 
 
Brian McCauley
Guest
Posts: n/a
 
      06-07-2006

Brian McCauley wrote:

> Are errors being sent to the return path address
> <(E-Mail Removed)>?


Note: if you want to control the return-path (aka envelope-from)
address used by Mail::Mailer::smtp you should set $ENV{MAILADDRESS} .

This is less than clear in the documentation.

 
Reply With Quote
 
Tintin
Guest
Posts: n/a
 
      06-07-2006

"L. Stern" <(E-Mail Removed)> wrote in message
news:4486ea25$0$29812$(E-Mail Removed)...
> Hello
>
> I am installing Bugzilla 2.22 on a Windows 2000 and I have some problem to
> configure the mail notification.
> In fact no email are sent. My problem is on the use of perl script to send
> email.
>
> I have made some simple Perl script (either via Mailer or directly via

SMTP)
> and it seems OK for me (no error), but no email are sent.
>
> The scripts and logs are below
>
> Exemple 1
>
> Script1
>
> use Mail::Mailer;
>
> $mailer = new Mail::Mailer('smtp', Server => "10.135.1.3",Debug => 2);
> #$mailer = new Mail::Mailer 'testfile', Server => "10.135.1.3";
>
> $mailer->open({From => '(E-Mail Removed)',
> To => '(E-Mail Removed)',
> Subject => "test 1234",})
> or die "Can't open: $!\n";
> print $mailer "Ceci est le texte";
> $mailer->close();
>
> Trace1
>
> Net::SMTP>>> Net::SMTP(2.29)
> Net::SMTP>>> Net::Cmd(2.26)
> Net::SMTP>>> Exporter(5.5
> Net::SMTP>>> IO::Socket::INET(1.29)
> Net::SMTP>>> IO::Socket(1.29)
> Net::SMTP>>> IO::Handle(1.25)
> Net::SMTP=GLOB(0x1a4ed4<<< 220 KIX001 ESMTP Service (Lotus Domino

Release
> 5.0.11) ready at Tue, 30 May 2006 14:25:55 +0200
> Net::SMTP=GLOB(0x1a4ed4>>> EHLO localhost.localdomain
> Net::SMTP=GLOB(0x1a4ed4<<< 250-KIX001 Hello localhost.localdomain
> ([136.0.1.0]), pleased to meet you
> Net::SMTP=GLOB(0x1a4ed4<<< 250-HELP
> Net::SMTP=GLOB(0x1a4ed4<<< 250-SIZE 51200000
> Net::SMTP=GLOB(0x1a4ed4<<< 250 PIPELINING
> Net::SMTP=GLOB(0x1a4ed4>>> MAIL

FROM:<(E-Mail Removed)>
> Net::SMTP=GLOB(0x1a4ed4<<< 250 (E-Mail Removed)...
> Sender OK
> Net::SMTP=GLOB(0x1a4ed4>>> RCPT TO:<(E-Mail Removed)>
> Net::SMTP=GLOB(0x1a4ed4<<< 250 (E-Mail Removed)... Recipient OK
> Net::SMTP=GLOB(0x1a4ed4>>> DATA
> Net::SMTP=GLOB(0x1a4ed4<<< 354 Enter message, end with "." on a line by
> itself
> Net::SMTP=GLOB(0x1a4ed4>>> Subject: test 1234
> Net::SMTP=GLOB(0x1a4ed4>>> X-Mailer: Mail::Mailer[v1.67]

Net::SMTP[v2.29]
> Net::SMTP=GLOB(0x1a4ed4>>> To: (E-Mail Removed)
> Net::SMTP=GLOB(0x1a4ed4>>> From: (E-Mail Removed)
> Net::SMTP=GLOB(0x1a4ed4>>> Ceci est le texte
> Net::SMTP=GLOB(0x1a4ed4>>> .
> Net::SMTP=GLOB(0x1a4ed4<<< 250 Message accepted for delivery
> Net::SMTP=GLOB(0x1a4ed4>>> QUIT
> Net::SMTP=GLOB(0x1a4ed4<<< 221 KIX001 SMTP Service closing transmission
> channel


There is no problem with your Perl script as can be seen from the above
trace. The SMTP server accepts the email and what happens to it after that
is entirely up to the SMTP server and the whole delivery chain.



--
Posted via a free Usenet account from http://www.teranews.com

 
Reply With Quote
 
L. Stern
Guest
Posts: n/a
 
      06-08-2006

"Brian McCauley" <(E-Mail Removed)> a écrit dans le message de news:
(E-Mail Removed). com...
>
> Brian McCauley wrote:
>
>> Are errors being sent to the return path address
>> <(E-Mail Removed)>?

>
> Note: if you want to control the return-path (aka envelope-from)
> address used by Mail::Mailer::smtp you should set $ENV{MAILADDRESS} .
>
> This is less than clear in the documentation.
>



Thank you,

Setting the $ENV{MAILADDRESS} I received an email with my problem:
In fact the "@" was not properly analyzed (the From and To was modified) and
I just have to change my "(E-Mail Removed)" to "name\@foo.com" to make it works

Laurent


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
encrypt smpt section of web config =?Utf-8?B?VGVycnkgSG9sbGFuZA==?= ASP .Net 0 10-01-2007 02:13 PM
my outlook express 5 can not send mail I get a message can not read your smpt. Veteran Computer Support 1 05-02-2004 02:49 AM
i am having trouble sending e-mail can not find my smpt Veteran Computer Support 2 05-02-2004 02:46 AM
smpt mail server Jeremy Micheau Computer Support 8 02-08-2004 08:39 AM
Intercept SMPT Email Robert Strickland ASP .Net 0 01-15-2004 02:01 AM



Advertisments