sub vianetsmtp { my $from = $_[0]; my $to = $_[1]; my $subject = $_[2]; my $body = $_[3]; $smtp = Net::SMTP->new ($maileroutrelay, Timeout => $mailerouttimeout, Debug => $maileroutdebug ) or logtofile ($logdir.'/usermailer',"can't create new smtp mail object"); defined ($smtp) or die; my $domainmessg = $smtp->domain; my $bannermessg = $smtp->banner; $smtp->mail($from); $smtp->to($to); $smtp->data; $smtp->datasend("from:$from"); $smtp->datasend("\n"); $smtp->datasend("subject:$subject"); $smtp->datasend("\n"); $smtp->datasend("$body"); $smtp->datasend("\n"); $smtp->quit; undef $smtp; logtofile ($logdir.'/usermailer',"usermailer: mail written via net::smtp"); return 1; }