note
toolic
I suspect the call to <c>new</c> returns an undefined value because it fails. The [mod://Net::SMTP] docs state:
<blockquote><i>
On failure undef will be returned and $@ will contain the reason for the failure.
</i></blockquote>
<p>You can try to get more information by showing $@:
<c>
$smtp = Net::SMTP->new("$servername", Debug => 1);
print "$@\n";
</c>
<p>Is $servername a valid remote host?
1209683
1209683