Perl and SMTP mail problems

Discussion in 'Perl Misc' started by dchirica@gmail.com, Jun 24, 2005.

  1. Guest

    Hello I tryied to send messaged from a Perl script running on win32.

    I have the following script modified for privacy reasons

    ########################################################
    use Net::SMTP;

    $smtp = Net::SMTP->new('my.domain.com', debug => 1);

    print $smtp->domain, "\n";

    $smtp->mail($ENV{USER});

    $smtp->to('');

    $smtp->data();

    $smtp->datasend("To: my.email\@yahoo.com\n");
    $smtp->datasend("From: email\@my.domain.com\n");
    $smtp->datasend("\n");

    # Send the body.
    #
    $smtp->datasend("Just a test message!\n");

    $smtp->dataend();
    $smtp->quit;
    ####################################################################

    When I run the script from command prompt with -w option I get the
    output from the print statement:
    > my.domain.com

    with no other errors.

    Now, the problem is that I never received the messages I send to
    (or other external email addresses).
    If I change the with my local email address, local
    to my.domain.com I do receive the messages.

    Does anyone know what is the problem? I am inclined to believe is
    something with my mail server which is a micro$soft exchange 5.5
    running on windows server 2000

    Thank you,
    Dan
     
    , Jun 24, 2005
    #1
    1. Advertising

  2. Larry Guest

    Probably the smtp server is rejecting the sender ($ENV{USER}). The
    best way I've found to debug SMTP problems is using the telnet command
    (avail. in Unix and Windows command prompt).

    Here's how to use it:

    http://www.yuki-onna.co.uk/email/smtp.html
     
    Larry, Jun 24, 2005
    #2
    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. Curt_C [MVP]
    Replies:
    5
    Views:
    373
    Karim
    May 19, 2004
  2. Replies:
    3
    Views:
    1,092
    Roedy Green
    Jan 24, 2006
  3. Alex Hunsley
    Replies:
    4
    Views:
    3,489
    Tim Williams (gmail)
    Jun 29, 2004
  4. Raaijmakers, Vincent \(GE Infrastructure\)

    RE: sending of mail (smtp) - connection refused - but smtp serveris running!

    Raaijmakers, Vincent \(GE Infrastructure\), Jun 29, 2004, in forum: Python
    Replies:
    0
    Views:
    888
    Raaijmakers, Vincent \(GE Infrastructure\)
    Jun 29, 2004
  5. Mikael H.
    Replies:
    1
    Views:
    228
    Robert Klemme
    Feb 21, 2011
Loading...

Share This Page