if($debug) { print STDERR "going to connect to $ssph->{host}\n"; } my $smtp= Net::SMTP->new (Host=> $ssph->{host}, ($ssph->{port} ? (Port=> $ssph->{port}) : ()), ($debug ? (Debug=> 1) : ()) ) || die "open SMTP $ssph->{host}: ".$!; if($debug) { print STDERR "connected to $ssph->{host}, going to auth\n"; } if($ssph->{user} and $ssph->{pass}) { $smtp->auth($ssph->{user}, $ssph->{pass}) || die "at auth: ".$smtp->message(); } if($debug) { print STDERR "auth to $ssph->{host} successful\n"; }