Gossamer Forum
Home : Products : DBMan : Customization :

Re: Email Notification

Quote Reply
Re: Email Notification In reply to
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/
Subject Author Views Date
Thread Email Notification with a BIG Twist Eliot 6032 Aug 3, 1999, 12:27 PM
Post Re: Email Notification with a BIG Twist
JPDeni 5907 Aug 3, 1999, 7:37 PM
Post Re: Email Notification with a BIG Twist
Eliot 5914 Aug 3, 1999, 7:43 PM
Post Re: Email Notification with a BIG Twist
JPDeni 5898 Aug 3, 1999, 8:14 PM
Post Re: Email Notification with a BIG Twist
Eliot 5910 Aug 3, 1999, 8:22 PM
Post Re: Email Notification with a BIG Twist
Eliot 5912 Aug 4, 1999, 5:25 AM
Post Re: Email Notification with a BIG Twist
Eliot 5899 Aug 4, 1999, 6:57 AM
Post Re: Email Notification with a BIG Twist
Eliot 5891 Aug 4, 1999, 7:52 AM
Post Re: Email Notification with a BIG Twist
JPDeni 5957 Aug 4, 1999, 9:07 AM
Post Re: Email Notification with a BIG Twist
compu_tel 5940 Aug 4, 1999, 10:02 AM
Thread Re: Email Notification with a BIG Twist
Eliot 5922 Aug 4, 1999, 10:50 AM
Thread Re: Email Notification
omegadm 5896 Jul 27, 2000, 8:00 AM
Thread Re: Email Notification
LoisC 5934 Jul 27, 2000, 11:12 AM
Post Re: Email Notification
omegadm 5947 Jul 27, 2000, 3:12 PM
Thread Re: [Eliot] Email Notification with a BIG Twist
mabel 5683 Dec 11, 2002, 12:27 AM
Post Re: [mabel] Email Notification with a BIG Twist
LoisC 5664 Dec 11, 2002, 9:14 PM
Post Re: Email Notification with a BIG Twist
Eliot 5908 Aug 4, 1999, 12:32 PM