Thanks Fred and Eliot for your replies. However, both of you have misunderstood what I was trying to explain.
I want to send html formatted email and not plain text email. This would mean the textarea would have html code within it that would be sent to someone's email client. When they open the email to read it, it would look like a web page instead of plain text. I already know how to get my html code into the test area.
Fred's code will not work because the html codes he provided are
NOT within the textarea. Eliot's tip is useful, but does not apply to what I was looking for.
However, I feel good again today for the second time! I have figured out a way to modify the code so that when using the forward record mod or the private emailer mod, the ability exists to send html email instead of plain text email.
Here is what you need to do in case anyone is interested. This does require the addition of another file called mimelite.pm that can be found on the web.
1) Get the mimelite.pm module and upload it (ascii mode) into the same directory as DBMan. Chmod it to 777 (that's what I used because I wasn't sure). If you can't find the right mimelite.pm module, I will post it as a text file for anyone interested).
2) In default.cfg, add the following code to your configuration options:
Code:
# Full directory path to where mimelite.pm html mailer is located.
use lib "/path/to/your/dbman/directory";
use mimelite;
3) In db.pl, find and change the following code in the new sub forward_email:
Code:
open (MAIL, "$mailprog") | | &cgierr("unable to open mail program");
print MAIL "To: $in{'to_email'})\n";
print MAIL "From: $in{'email'}\n";
print MAIL "Subject: $in{'subject'}\n\n";
print MAIL "-" x 75 . "\n\n";
print MAIL $in{'emailmessage'};
close (MAIL);
Change it to:
Code:
open (MAIL, "$mailprog") | | &cgierr("unable to open mail program");
print MAIL "To: $in{'to_email'})\n";
print MAIL "From: $in{'email'}\n";
print MAIL "X-Mailer: MIME::Lite\n";
print MAIL "Content-type: text/html\n\n";
print MAIL $in{'emailmessage'};
close (MAIL);
4) Now,you have 2 options:
a) "hard code" your record to be forwarded and any html formatting within the new sub html_forward_email_form in html.pl
Example (look for this line):
Code:
<textarea name="emailmessage" cols=40 rows=10 wrap="virtual"><h3>$rec{'Name'}</h3><br><font face="arial" size="3">$rec{'Email'}</font></textarea></td></tr>
etc, etc, etc.
or option 2:
b) Leave the text area blank and when the send email form pops up, let the user enter their own message with any html markup they wish to include.
When the message is sent, any email clients that can read html messages will see a message that looks like a web page!
Again, if anyone needs the mimelite.pm file, I will post it or email it to you.