in reply to Getting Filehandle from Mail::Mailer

Anyone see anything wrong with this approach? I've been using it for a while...
sub SendEmail { my ($to,$from,$subject,$msg) = @_; my $host = '192.168.193.10'; # your mailhost if ($to) { use Net::SMTP; $smtp = Net::SMTP->new($host); $smtp->mail($from); $smtp->to($to); $smtp->data(); $smtp->datasend("From: $from\n"); $smtp->datasend("To: $to\n"); $smtp->datasend("Subject: $subject\n"); $smtp->datasend("\n"); $smtp->datasend("$msg\n"); $smtp->dataend(); $smtp->quit; return(1); } else { return(0); } }
The error cases could use some improovement, I know... But, HTH!

UPDATED (ala Slashdot):
Sorry about this post, it doesn't reply the asked question...
I guess I just got carried away.

#!/home/bbq/bin/perl
# Trust no1!