|
Posted by still just me on March 10, 2008, 3:57 pm
Please log in for more thread options
>still just me wrote:
>> I'm using Net::SMTP to send mail from a perl program running on a web
>> server. Code is as follows:
>>
>> my $relay="smtp.example.com";
>> my $smtp = Net::SMTP->new($relay);
>> die "Could not open connection: $!" if (! defined $smtp);
>
>The docs for Net::SMTP does not say that it sets $!, so don't rely on that.
>
>Have you tried turning on debugging?
>
> $smtp = Net::SMTP->new(
> Host => 'smtp.example.com',
> Hello => 'my.mail.domain'
> Timeout => 30,
> Debug => 1,
> );
Interesting on the $! issue... it seems to throw the right error when
the connection is refused. As you noted, perhaps the other message is
not reliable.
What should the debug mode above do for me? I don't seem to get any
additional information when I incorporate it.
|