On failure undef will be returned and $@ will contain the reason for the failure.
You can try to get more information by showing $@:
$smtp = Net::SMTP->new("$servername", Debug => 1); print "$@\n";
Is $servername a valid remote host?
In reply to Re: Undefined value error
by toolic
in thread Undefined value error
by clarkmurph
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |