The modified code in html.pl is as follows:
sub html_add_success {
####################################################################
# S E N D E M A I L A F T E R R E C O R D I S A D D E D
#
# by JPDeni
# last edited 2 May 2001
#
# To send mail to the admin after a record is added
#
# script: html.pl
# sub html_add_success
#
# add new lines
#
# Where to put it--
# right at the beginning of the subroutine, before any other lines
###################################################################
my (%rec) = &get_record($in{$db_key});
open (MAIL, "$mailprog") || &cgierr("Can't start mail program");
print MAIL "To: $admin_email\n";
print MAIL "From: $admin_email\n";
print MAIL "Subject: $html_title New Record\n\n";
print MAIL "The following new record has been added to the database:.\n\n";
foreach $col ($db_cols) {
print MAIL "$col -- $rec{$col}\n";
}
close (MAIL);
# --------------------------------------------------------
# The page that is returned upon a successful addition to
# the database. You should use &get_record and &html_record
# to verify that the record was inserted properly and to make
# updating easier.
&html_print_headers;
print qq|
<html>
<head>
<title>$html_title: Record Added.</title>
</head>
<body bgcolor="#FFFFFF">
$html_head_text
<table border=0 bgcolor="#FFFFFF" cellpadding=5 cellspacing=3 width=90% align=center valign=top>
<tr><td colspan=2 bgcolor="#e7ba42">
<FONT FACE="arial,helvetica" size=1 COLOR="#000000">
<b>$html_title: Record Added</b>
</td></tr>
<tr><td>
<p><center><$font_title><b>
Record Added
</b></font></center><br>
<$font>
<P><Font face="Verdana, Arial, Helvetica" Size=2>The following record was successfully added to the database:</FONT>
|; &html_record(&get_record($in{$db_key})); print qq|
</font></p>
|; &html_footer; print qq|
</td></tr>
</table>
</center>
</body>
</html>
|;
}
And this is what I have added in default.cfg
# Full path to sendmail on your system
$mailprog = "|/usr/lib/sendmail -t";
# Your email address
$admin_email =
'webmaster@aarknet.com';
I want the entire record details to be received in the email but I receive an empty email with the following body text:
The following new record has been added to the database:.
--
and following subject line:
Subject: Jobs Listing at GulfJobSites.com New Record
Please advise what needs to be corrected.
Thanks for your time.
Raza