Here are the codes: (For SMTP Mailer and Sendmail)
==========================================
SMTP Mailer
==========================================
You must first download the Mailer.pm, which is available in the LINKS package. Then in your default.cfg file, add this line of code in your authorization section:
require $mailer_path . "/Mailer.pm";
Then in the default.cgi file, add this line of code:
For a simple message that will send out an email message notifying the webmaster or data manager that a record has been added, use these instructions:
In add_record sub-routine in default.cgi:
1) Add the following codes AFTER &html_add_success; in the add_record:
my $mailer = new Mailer ( { smtp => 'SMTPSERVER' } ) or die "Can't init mailer: $Mailer::error";
$mailer->send ( {
to => 'Recipient Email Address',
from => 'Your Email Address',
subject => "Record Added to Database",
msg => "Message"
} )
or die "Can't send mail: $Mailer::error";
2) Replace the following statements:
* SMTPSERVER = Your SMTP Server
* Recipient Email Address = Your email address
* Your Email Address = Your email address or the server admin address
* Message = Message you want to send.
If you want to send a detailed message to the record owner, use these instructions:
In add_record sub-routine in default.cgi:
1) Add the following codes AFTER ($auth_user_field >= 0) and ($in{$db_cols[$auth_user_field]} = $db_userid);:
2) Add the following codes AFTER &html_add_success; in the add_record:
my $mailer = new Mailer ( { smtp => 'SMTPSERVER' } ) or die "Can't init mailer: $Mailer::error";
$mailer->send ( {
to => '$in{'Email'},',
from => 'Your Email Address',
subject => "Record Added to Database",
msg => "Message"
} )
or die "Can't send mail: $Mailer::error";
3) Replace the following statements:
* SMTPSERVER = Your SMTP Server
* Your Email Address = Your email address or the server admin address
* Message = Message you want to send.
Note: In the Message variable ($msg), you can add a complete record report by including fields in the following fashion:
$in{'FieldName'}
Change FieldName with the appropriate field name(s) that are located in your default.cfg file.
==========================================
Sendmail Program
==========================================
For a simple message that will send out an email message notifying the webmaster or data manager that a record has been added, use these instructions:
1) In default.cfg, add these lines of code after the reference for html.pl
$mailprog = "|/usr/lib/sendmail -t -oeq";
# Your email address
$admin_email= 'YOUR EMAIL ADDRESS';
Replace YOUR EMAIL ADDRESS with your email address.
In add_record sub-routine in default.cgi:
2) Add the following codes AFTER &html_add_success;:
print MAIL "To : youraccount\@server.com\n";
print MAIL "From: $admin_email\n";
print MAIL "Subject: Record Added to $html_title\n\n";
print MAIL "You have added a record to the $html_title\n\n";
close (MAIL);
Replace the bolded statement with your email addresses. Make sure that you put a \ before @.
If you want to send a detailed message to the record owner, use these instructions:
In add_record sub-routine in default.cgi:
1) Add the following codes AFTER ($auth_user_field >= 0) and ($in{$db_cols[$auth_user_field]} = $db_userid);:
2) Add the following codes AFTER &html_add_success; in the add_record:
if ($db_use_flock) {
flock(PASSWD, 2) or &cgierr("unable to get exclusive lock on $auth_pw_file.\nReason: $!");
}
@passwds = <PASSWD>;
close PASSWD;
foreach $pass (@passwds) {
if ($pass =~ /^$db_userid:/) {
@data = split ":",$pass;
$email = $data[7];
last;
}
}
open (MAIL, "$mailprog") | | &cgierr("unable to open mail program");
print MAIL "To: $email\n";
print MAIL "From: $admin_email\n";
print MAIL "Subject: Record Added to $html_title\n\n";
print MAIL "You have added a record to the $html_title\n\n";
print MAIL "Please save this message for future reference.\n\n";
print MAIL "Your record ID is: $rec{'ID'}\n\n";
Note: In the Message variable ($msg), you can add a complete record report by including fields in the following fashion:
$rec{'FieldName'}
Change FieldName with the appropriate field name(s) that are located in your default.cfg file.
This particular modification requires the NEWEST password lookup mod. But you could just delete the codes before open (MAIL...and add the EMAIL field in the To line. (If you have an email field).
These modifications can be added to the modify_record and delete_record. Make sure that you insert the "mailing" codes ($mailer or open (MAIL...) after the following codes:
In modify_record:
In delete_records:
I really hope this helps. If you have any questions, let me know.
Regards,
------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
[This message has been edited by Eliot (edited August 04, 1999).]
==========================================
SMTP Mailer
==========================================
You must first download the Mailer.pm, which is available in the LINKS package. Then in your default.cfg file, add this line of code in your authorization section:
Code:
# Full path and file name of the Mailer Program. require $mailer_path . "/Mailer.pm";
Then in the default.cgi file, add this line of code:
Code:
$mailer_path ="/path/cgi-bin/sendmail";For a simple message that will send out an email message notifying the webmaster or data manager that a record has been added, use these instructions:
In add_record sub-routine in default.cgi:
1) Add the following codes AFTER &html_add_success; in the add_record:
Code:
# Send email when new record is added my $mailer = new Mailer ( { smtp => 'SMTPSERVER' } ) or die "Can't init mailer: $Mailer::error";
$mailer->send ( {
to => 'Recipient Email Address',
from => 'Your Email Address',
subject => "Record Added to Database",
msg => "Message"
} )
or die "Can't send mail: $Mailer::error";
2) Replace the following statements:
* SMTPSERVER = Your SMTP Server
* Recipient Email Address = Your email address
* Your Email Address = Your email address or the server admin address
* Message = Message you want to send.
If you want to send a detailed message to the record owner, use these instructions:
In add_record sub-routine in default.cgi:
1) Add the following codes AFTER ($auth_user_field >= 0) and ($in{$db_cols[$auth_user_field]} = $db_userid);:
Code:
%rec = &get_record($in{$db_key});2) Add the following codes AFTER &html_add_success; in the add_record:
Code:
# Send email when new record is added my $mailer = new Mailer ( { smtp => 'SMTPSERVER' } ) or die "Can't init mailer: $Mailer::error";
$mailer->send ( {
to => '$in{'Email'},',
from => 'Your Email Address',
subject => "Record Added to Database",
msg => "Message"
} )
or die "Can't send mail: $Mailer::error";
3) Replace the following statements:
* SMTPSERVER = Your SMTP Server
* Your Email Address = Your email address or the server admin address
* Message = Message you want to send.
Note: In the Message variable ($msg), you can add a complete record report by including fields in the following fashion:
$in{'FieldName'}
Change FieldName with the appropriate field name(s) that are located in your default.cfg file.
==========================================
Sendmail Program
==========================================
For a simple message that will send out an email message notifying the webmaster or data manager that a record has been added, use these instructions:
1) In default.cfg, add these lines of code after the reference for html.pl
Code:
# Full path to sendmail on your system $mailprog = "|/usr/lib/sendmail -t -oeq";
# Your email address
$admin_email= 'YOUR EMAIL ADDRESS';
Replace YOUR EMAIL ADDRESS with your email address.
In add_record sub-routine in default.cgi:
2) Add the following codes AFTER &html_add_success;:
Code:
open (MAIL, "$mailprog") | | &cgierr("unable to open mail program"); print MAIL "To : youraccount\@server.com\n";
print MAIL "From: $admin_email\n";
print MAIL "Subject: Record Added to $html_title\n\n";
print MAIL "You have added a record to the $html_title\n\n";
close (MAIL);
Replace the bolded statement with your email addresses. Make sure that you put a \ before @.
If you want to send a detailed message to the record owner, use these instructions:
In add_record sub-routine in default.cgi:
1) Add the following codes AFTER ($auth_user_field >= 0) and ($in{$db_cols[$auth_user_field]} = $db_userid);:
Code:
%rec = &get_record($in{$db_key});2) Add the following codes AFTER &html_add_success; in the add_record:
Code:
open (PASSWD, "<$auth_pw_file") or &cgierr("unable to open password file. Reason: $!\n"); if ($db_use_flock) {
flock(PASSWD, 2) or &cgierr("unable to get exclusive lock on $auth_pw_file.\nReason: $!");
}
@passwds = <PASSWD>;
close PASSWD;
foreach $pass (@passwds) {
if ($pass =~ /^$db_userid:/) {
@data = split ":",$pass;
$email = $data[7];
last;
}
}
open (MAIL, "$mailprog") | | &cgierr("unable to open mail program");
print MAIL "To: $email\n";
print MAIL "From: $admin_email\n";
print MAIL "Subject: Record Added to $html_title\n\n";
print MAIL "You have added a record to the $html_title\n\n";
print MAIL "Please save this message for future reference.\n\n";
print MAIL "Your record ID is: $rec{'ID'}\n\n";
Note: In the Message variable ($msg), you can add a complete record report by including fields in the following fashion:
$rec{'FieldName'}
Change FieldName with the appropriate field name(s) that are located in your default.cfg file.
This particular modification requires the NEWEST password lookup mod. But you could just delete the codes before open (MAIL...and add the EMAIL field in the To line. (If you have an email field).
These modifications can be added to the modify_record and delete_record. Make sure that you insert the "mailing" codes ($mailer or open (MAIL...) after the following codes:
In modify_record:
Code:
&html_modify_success;In delete_records:
Code:
&html_delete_success;I really hope this helps. If you have any questions, let me know.
Regards,
------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
[This message has been edited by Eliot (edited August 04, 1999).]