... MIME::Lite->send( 'smtp' => $args->{'smtp'}, 'AuthUser' => $uid, 'AuthPass' => $args->{'smtppw'} ); ... #### my $smtp = MIME::Lite::SMTP->new( $hostname, %opts ) or Carp::croak "SMTP Failed to connect to mail server: $!\n"; # Possibly authenticate if ( defined $args{AuthUser} and defined $args{AuthPass} and !$args{NoAuth} ) { if ($smtp->supports('AUTH',500,["Command unknown: 'AUTH'"])) { $smtp->auth( $args{AuthUser}, $args{AuthPass} ) or die "SMTP auth() command failed: $!\n" . $smtp->message . "\n"; } else { die "SMTP auth() command not supported on $hostname\n"; } }