in reply to Trouble getting Net::SMTP to work

I would suspect that the mail server is not accepting your connection for some reason - to be sure you can turn on the debugging output in the constructor by changing it to:

$smtp = Net::SMTP->new('smtpmail.server.com', Debug => 1);
If this does not produce any output then it is likely that there is a network problem - either the address of the mail server cannot be resolved or you cannot connect to the server for some other reason. You could try connecting to port 25 of the server using telnet from the command line.

/J\

Replies are listed 'Best First'.
Re^2: Trouble getting Net::SMPT to work
by yankeeblue (Novice) on Apr 20, 2005 at 15:10 UTC
    I had the debug flag in and got no additional output. I tried to telnet to port 25 of the SMTP server and I got back:

    "Connecting To smtpmail.server.com...Could not open connection to the host, on port 25: Connect failed"

    When I did the same thing on another box, logged in as myself I can connect:

    "220 ips-dc87-xch.server.com ESMTP Server (Microsoft Exchange Internet Mail Service 5.5.2657.72) ready"

    So it does look like some sort of network problem with this new box or new user. I'm working with my local IT folks to try and figure it out. Thanks for your help.
      Thanks for everyone's help. It turns out that by Default, McAfee VirusScan was blocking sending mail using Port 25 of the SMTP mail server. I had to allow access to that port.