This has been taken from the FAQ noted below under "Email"
BCC, CC, and Return Path
There are several variables you can define when sending email. View the following
examples to see if there is something you want to try in your script.
Added two things in the send mail.
1. A return path
2. BCC (blind carbon copy)
The admin gets a copy of the email, and bounced emails return to the system. You
can also include the date.
sub sendemail {
#----------------------------
$returnpath="xxx\@yyy.com";
$FROM="sss\@yyy.com";
$TO=$_[0];
@TO=split('\0',$TO);
$BCC="xxx\@yyyc.com";
$SUBJECT=$_[1];
$REPLYTO="sss\@yyy.com";
$REMOTE = $_[3];
$THEMESSAGE = $_[4];
$nowtime = localtime(time);
open(S, "|$REMOTE -t");
print S "Return-Path: $returnpath\n";
print S "To: $TO[0]\n";
print S "BCC: $BCC\n";
print S "From: $FROM\n";
print S "Subject: $SUBJECT\n";
print S "-" x 75 . "\n\n";
print S "Date: $nowtime\n";
print S "Reply-To: $REPLYTO\n\n";
# Print the body
print S "$THEMESSAGE\n";
print S "\n";
print S ".\n";
close (S);
}
OR this version:
sub sendemail {
#----------------------------
$returnpath="xxx\@yyy.com";
$FROM="sss\@yyy.com";
$TO=$_[0];
@TO=split('\0',$TO);
$BCC="xxx\@yyyc.com";
$SUBJECT=$_[1];
$REPLYTO="sss\@yyy.com";
$REMOTE = $_[3];
$THEMESSAGE = $_[4];
$nowtime = localtime(time);
open (MAIL, "|/usr/lib/sendmail -t");
print MAIL "Return-Path: $returnpath\n";
print MAIL "To: $TO[0]\n";
print MAIL "BCC: $BCC\n";
print MAIL "From: $FROM\n";
print MAIL "Subject: $SUBJECT\n";
print MAIL "-" x 75 . "\n\n";
print MAIL "Date: $nowtime\n";
print MAIL "Reply-To: $REPLYTO\n\n";
# Print the body
print MAIL "$THEMESSAGE\n";
print MAIL "\n\n";
close (MAIL);
}
This has worked for others .. let me know if it helps.
Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
BCC, CC, and Return Path
There are several variables you can define when sending email. View the following
examples to see if there is something you want to try in your script.
Added two things in the send mail.
1. A return path
2. BCC (blind carbon copy)
The admin gets a copy of the email, and bounced emails return to the system. You
can also include the date.
sub sendemail {
#----------------------------
$returnpath="xxx\@yyy.com";
$FROM="sss\@yyy.com";
$TO=$_[0];
@TO=split('\0',$TO);
$BCC="xxx\@yyyc.com";
$SUBJECT=$_[1];
$REPLYTO="sss\@yyy.com";
$REMOTE = $_[3];
$THEMESSAGE = $_[4];
$nowtime = localtime(time);
open(S, "|$REMOTE -t");
print S "Return-Path: $returnpath\n";
print S "To: $TO[0]\n";
print S "BCC: $BCC\n";
print S "From: $FROM\n";
print S "Subject: $SUBJECT\n";
print S "-" x 75 . "\n\n";
print S "Date: $nowtime\n";
print S "Reply-To: $REPLYTO\n\n";
# Print the body
print S "$THEMESSAGE\n";
print S "\n";
print S ".\n";
close (S);
}
OR this version:
sub sendemail {
#----------------------------
$returnpath="xxx\@yyy.com";
$FROM="sss\@yyy.com";
$TO=$_[0];
@TO=split('\0',$TO);
$BCC="xxx\@yyyc.com";
$SUBJECT=$_[1];
$REPLYTO="sss\@yyy.com";
$REMOTE = $_[3];
$THEMESSAGE = $_[4];
$nowtime = localtime(time);
open (MAIL, "|/usr/lib/sendmail -t");
print MAIL "Return-Path: $returnpath\n";
print MAIL "To: $TO[0]\n";
print MAIL "BCC: $BCC\n";
print MAIL "From: $FROM\n";
print MAIL "Subject: $SUBJECT\n";
print MAIL "-" x 75 . "\n\n";
print MAIL "Date: $nowtime\n";
print MAIL "Reply-To: $REPLYTO\n\n";
# Print the body
print MAIL "$THEMESSAGE\n";
print MAIL "\n\n";
close (MAIL);
}
This has worked for others .. let me know if it helps.
Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/