Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

The last 3 days I've been reading up on how to setup a SMPT server on my Windows IIS and trying to use Perl to send mail using that smpt server. I realized that I didn't have too, and I spent the last 3 days researching for nothing.

Now I'm back here again trying to send mail using Perl on Windows. This is a daunting task, because I never got this to work. I got sendmail working on a Linux box , but not a Windows one.

Heres my scenario, I'm using Mail::Sendmail and found out that my smpt server is the one that my nameserver is hosted on. The provider is comcast, so the relay server is smpt.comcast.com. I was told that when using this, it'll recognize my machine and allow me to use it as a relay.

So my code is the following (which still doesn't send mail):
use Mail::Sendmail; # Set up some default configuration unshift @{$Mail::Sendmail::mailcfg{'smtp'}} , 'smtp.comcast.com'; $Mail::Sendmail::mailcfg{'from'} = "test\@aol.com"; my %mail = ( To => "mytestaddress\@aol.com", #real add changed for this ex. Subject => "Test 1", Message => "Test number 1", ); sendmail( %mail ) or print "Error: $Mail::Sendmail::error\n"; print "Sent Successfully";
Now the above code, does not generate a Mail::Sendmail::error, and prints out "Sent Successfully", but I do not receive anything. Does anyone know if this would be a Perl problem I'm having or some setup I'm not doing correctly? Anyone dealt with using comcast relay server ? ahhh...I'm going nuts the last 3 days trying to get my perl script to send mail on windows.

Thanks for your time in reading all of this...
Brendan

Replies are listed 'Best First'.
Re: Sending Mail Scenario with Windows
by astroboy (Chaplain) on Jul 21, 2005 at 04:37 UTC
    Seems a little complicated. Have you tried the following:
    use Mail::Sendmail; my %mail = ( To => 'mytestaddress@aol.com', From => 'test@aol.com', Subject => 'Test 1', Message => 'Test number 1', smtp => 'smtp.comcast.com' ); sendmail(%mail) || print "Error sending mail: $Mail::Sendmail::error\n +";
    I get
    Error sending mail: smtp.comcast.com not found connect to localhost failed (Unknown error) connect to localhost failed connect to localhost failed (Unknown error) no (more) retries!
    I suspect that the comcast server won't allow me to connect however! (... assuming it exists - "nslookup smtp.comcast.com" fails for me)
      hey, sorry

      yeah I meant smtp.comcast.net

      Brendan

        Ok, well I fixed the smtp server name, but i get "Error sending mail: MAIL FROM: error (530 Authentication required)," which is to be expected.

        What do you get if you try reformatting your code as per my example?