Problem with SMPT mail

Discussion in 'Perl Misc' started by L. Stern, Jun 7, 2006.

  1. L. Stern

    L. Stern Guest

    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 => '',
    To => '',
    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.58)
    Net::SMTP>>> IO::Socket::INET(1.29)
    Net::SMTP>>> IO::Socket(1.29)
    Net::SMTP>>> IO::Handle(1.25)
    Net::SMTP=GLOB(0x1a4ed48)<<< 220 KIX001 ESMTP Service (Lotus Domino Release
    5.0.11) ready at Tue, 30 May 2006 14:25:55 +0200
    Net::SMTP=GLOB(0x1a4ed48)>>> EHLO localhost.localdomain
    Net::SMTP=GLOB(0x1a4ed48)<<< 250-KIX001 Hello localhost.localdomain
    ([136.0.1.0]), pleased to meet you
    Net::SMTP=GLOB(0x1a4ed48)<<< 250-HELP
    Net::SMTP=GLOB(0x1a4ed48)<<< 250-SIZE 51200000
    Net::SMTP=GLOB(0x1a4ed48)<<< 250 PIPELINING
    Net::SMTP=GLOB(0x1a4ed48)>>> MAIL FROM:<>
    Net::SMTP=GLOB(0x1a4ed48)<<< 250 ...
    Sender OK
    Net::SMTP=GLOB(0x1a4ed48)>>> RCPT TO:<>
    Net::SMTP=GLOB(0x1a4ed48)<<< 250 ... Recipient OK
    Net::SMTP=GLOB(0x1a4ed48)>>> DATA
    Net::SMTP=GLOB(0x1a4ed48)<<< 354 Enter message, end with "." on a line by
    itself
    Net::SMTP=GLOB(0x1a4ed48)>>> Subject: test 1234
    Net::SMTP=GLOB(0x1a4ed48)>>> X-Mailer: Mail::Mailer[v1.67] Net::SMTP[v2.29]
    Net::SMTP=GLOB(0x1a4ed48)>>> To:
    Net::SMTP=GLOB(0x1a4ed48)>>> From:
    Net::SMTP=GLOB(0x1a4ed48)>>> Ceci est le texte
    Net::SMTP=GLOB(0x1a4ed48)>>> .
    Net::SMTP=GLOB(0x1a4ed48)<<< 250 Message accepted for delivery
    Net::SMTP=GLOB(0x1a4ed48)>>> QUIT
    Net::SMTP=GLOB(0x1a4ed48)<<< 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('');# use the sender's adress here
    $smtp->to(''); #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.58)
    Net::SMTP>>> IO::Socket::INET(1.29)
    Net::SMTP>>> IO::Socket(1.29)
    Net::SMTP>>> IO::Handle(1.25)
    Net::SMTP=GLOB(0x1c29bd8)<<< 220 KIX001 ESMTP Service (Lotus Domino Release
    5.0.11) ready at Tue, 6Jun 2006 15:04:11 +0200
    Net::SMTP=GLOB(0x1c29bd8)>>> EHLO localhost.localdomain
    Net::SMTP=GLOB(0x1c29bd8)<<< 250-KIX001 Hello localhost.localdomain
    ([136.0.1.0]), pleased to meet you
    Net::SMTP=GLOB(0x1c29bd8)<<< 250-HELP
    Net::SMTP=GLOB(0x1c29bd8)<<< 250-SIZE 51200000
    Net::SMTP=GLOB(0x1c29bd8)<<< 250 PIPELINING
    Net::SMTP=GLOB(0x1c29bd8)>>> MAIL FROM:<>
    Net::SMTP=GLOB(0x1c29bd8)<<< 250 ... Sender OK
    Net::SMTP=GLOB(0x1c29bd8)>>> RCPT TO:<>
    Net::SMTP=GLOB(0x1c29bd8)<<< 250 ... Recipient OK
    Net::SMTP=GLOB(0x1c29bd8)>>> DATA
    Net::SMTP=GLOB(0x1c29bd8)<<< 354 Enter message, end with "." on a line by
    itself
    Net::SMTP=GLOB(0x1c29bd8)>>> test
    Net::SMTP=GLOB(0x1c29bd8)>>> .
    Net::SMTP=GLOB(0x1c29bd8)<<< 250 Message accepted for delivery
    Net::SMTP=GLOB(0x1c29bd8)>>> QUIT
    Net::SMTP=GLOB(0x1c29bd8)<<< 221 KIX001 SMTP Service closing transmission
    channel


    Thanks in advance for any help on my problem.

    Regards
    Laurent STERN
     
    L. Stern, Jun 7, 2006
    #1
    1. Advertising

  2. 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
    <>?

    Have you tried sending a test mail (by another mechanism) to
    <> to make sure that it is working?
     
    Brian McCauley, Jun 7, 2006
    #2
    1. Advertising

  3. Brian McCauley wrote:

    > Are errors being sent to the return path address
    > <>?


    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.
     
    Brian McCauley, Jun 7, 2006
    #3
  4. L. Stern

    Tintin Guest

    "L. Stern" <> wrote in message
    news:4486ea25$0$29812$...
    > 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 => '',
    > To => '',
    > 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.58)
    > Net::SMTP>>> IO::Socket::INET(1.29)
    > Net::SMTP>>> IO::Socket(1.29)
    > Net::SMTP>>> IO::Handle(1.25)
    > Net::SMTP=GLOB(0x1a4ed48)<<< 220 KIX001 ESMTP Service (Lotus Domino

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

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

    Net::SMTP[v2.29]
    > Net::SMTP=GLOB(0x1a4ed48)>>> To:
    > Net::SMTP=GLOB(0x1a4ed48)>>> From:
    > Net::SMTP=GLOB(0x1a4ed48)>>> Ceci est le texte
    > Net::SMTP=GLOB(0x1a4ed48)>>> .
    > Net::SMTP=GLOB(0x1a4ed48)<<< 250 Message accepted for delivery
    > Net::SMTP=GLOB(0x1a4ed48)>>> QUIT
    > Net::SMTP=GLOB(0x1a4ed48)<<< 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
     
    Tintin, Jun 7, 2006
    #4
  5. L. Stern

    L. Stern Guest

    "Brian McCauley" <> a écrit dans le message de news:
    ...
    >
    > Brian McCauley wrote:
    >
    >> Are errors being sent to the return path address
    >> <>?

    >
    > 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 "" to "name\@foo.com" to make it works

    Laurent
     
    L. Stern, Jun 8, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robert Strickland

    Intercept SMPT Email

    Robert Strickland, Jan 15, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    389
    Robert Strickland
    Jan 15, 2004
  2. =?Utf-8?B?TXJGZXo=?=

    Mail message size problem (System.Web.Mail)

    =?Utf-8?B?TXJGZXo=?=, Mar 14, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    642
    =?Utf-8?B?TXJGZXo=?=
    Mar 14, 2005
  3. =?Utf-8?B?VGVycnkgSG9sbGFuZA==?=

    encrypt smpt section of web config

    =?Utf-8?B?VGVycnkgSG9sbGFuZA==?=, Oct 1, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    445
    =?Utf-8?B?VGVycnkgSG9sbGFuZA==?=
    Oct 1, 2007
  4. Simon Cheng

    POP-before-SMPT

    Simon Cheng, Nov 27, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    119
    Simon Cheng
    Nov 28, 2005
  5. Simon Andrews

    SMPT Connection Errors

    Simon Andrews, Dec 1, 2004, in forum: Perl Misc
    Replies:
    3
    Views:
    105
    Simon Andrews
    Dec 1, 2004
Loading...

Share This Page