I'm not exactly sure but I "think" this is the script. It's the only script I can find that refers to mail. I do not have access to the server itself as this is a leased hosting.
Please advise further??
sub SendMail{
my($to,$from,$subject,$message,$mailserver,$cc,$bcc) = @_;
@allto = split(",",$to);
@allcc = split(",",$cc);
@allbcc = split(",",$bcc);
use Net::SMTP;
(!$to)&&(return 0);
(!$subject)&&(!$message)&&(return 0);
@s = split("\n",$subject);
eval {
my $smtp = Net::SMTP->new($mailserver, Debug=>0);
$smtp->mail( $from );
$smtp->to(@allto);
$smtp->data();
$smtp->datasend("To: $to\n");
$smtp->datasend("From: $from\n");
$smtp->datasend("Subject: $s[0]\n");
for $i (1..$#s){
$smtp->datasend("$s[$i]\n");
}
$smtp->datasend("\n");
$smtp->datasend("$message");
$smtp->dataend();
$smtp->quit;
if(@allcc){
my $smtp = Net::SMTP->new($mailserver, Debug=>0);
$smtp->mail( $from );
$smtp->to(@allcc);
$smtp->data();
$smtp->datasend("To: $to\n");
$smtp->datasend("From: $from\n");
$smtp->datasend("CC: $cc\n");
$smtp->datasend("Subject: $s[0]\n");
for $i (1..$#s){
$smtp->datasend("$s[$i]\n");
}
$smtp->datasend("\n");
$smtp->datasend("$message");
$smtp->dataend();
$smtp->quit;
}
if(@allbcc){
my $smtp = Net::SMTP->new($mailserver, Debug=>0);
$smtp->mail( $from );
$smtp->to(@allbcc);
$smtp->data();
$smtp->datasend("To: $to\n");
$smtp->datasend("From: $from\n");
$smtp->datasend("Subject: $s[0]\n");
for $i (1..$#s){
$smtp->datasend("$s[$i]\n");
}
$smtp->datasend("\n");
$smtp->datasend("$message");
$smtp->dataend();
$smtp->quit;
}
};
if ($@) {
print "Error occured while trying to send a mail to $mailserver<br>";
return 0;
}
return 1;
}
1;