Ooops... I just noticed that I didn't post the mail sub - I posted the mail form. Duh!
Heres the mail sub that I am using... I tried it and then used the <HTML><BODY> tags in the message as suggested... but still get a text formatted message in the email instead of HTML formated.
Any ideas?
TIA,
Donm
Here's the code I am using:
sub send_email {
# --------------------------------------------------------
# This subroutine added for the private email mod
#
unless ($in{'EmailAddress'}) { $message = "You must fill in your email address<BR>"; }
unless ($in{'EmailAddress'} =~ /.+\@.+\..+/) { $message = "Your email address is not in the correct format.<BR>"; }
unless ($in{'subject'}) { $message .= "You must fill in a subject for your message.<BR>"; }
unless ($in{'emailmessage'}) { $message .= "Your email message is empty.<BR>"; }
%rec = &get_record($in{$db_key});
if (!%rec) { $message .= "The email address you requested could not be found.<BR>"; }
elsif (!$rec{$db_email_field}) { $message .= "There is no email address on file for this person.<BR>" }
if ($message) {
chomp($message); &html_send_email_form($message);
return;
}
open (MAIL, "$mailprog") || &cgierr("unable to open mail program");
print MAIL "To: $rec{$db_email_field}\n";
print MAIL "BCC: $BCC\n";
print MAIL "From: $in{'EmailAddress'}\n";
print MAIL "Subject: $in{'subject'}\n\n";
print MAIL "$in{'EmailAddress'} used the email system\n";
print MAIL "at
http://xxxxxxx.xxx to send you this message\n";
print MAIL "-" x 75 . "\n\n";
print MAIL "MIME-Version: 1.0\n";
print MAIL "Content-Type: text/html; charset=us-ascii\n";
print MAIL "Content-Transfer-Encoding: 7bit\n";
print MAIL $in{'emailmessage'};
print MAIL "\n\n";
print MAIL &emailadv; ## Random E-Mail Advertisement
close (MAIL); &html_send_email_success;
}