#!/usr/bin/perl sub sendemail { use Net::SMTP; use Getopt::Long; $TO=$_[0]; @TO=split('\0',$TO); $SUBJECT=$_[1]; $REPLYTO=$_[2]; $REMOTE = $_[3]; $THEMESSAGE = $_[4]; $smtp = Net::SMTP->new("mail.opus1.com"); $smtp->mail("FL-Auction.PL\@FutureLocation.COM"); foreach (0..$#TO) { $smtp->to($TO[$_]); } $smtp->data(); $smtp->datasend("To: $TO[0]\n"); if ($#TO > 0) { foreach (1..$#TO) { $smtp->datasend("Cc: $TO[$_]\n"); }} $smtp->datasend("Subject: $SUBJECT\n"); if ( $REPLYTO ne "" ) { $smtp->datasend("Reply-To: $REPLYTO\n"); } $smtp->datasend("\n"); # Print the body $smtp->datasend($THEMESSAGE); $smtp->dataend; }