This topic is locked

Email Form

2/13/2007 5:30:35 PM
PHPRunner General questions
D
drh author

Hello forum members.
I need to create a form which will contain about 30 fields. In addition, it will have header with an image and text and a footer with text. This form will be completed by the user, and on completion emailed to an email address of my choice. The contents will be destroyed after the email is sent. No need or desire to store the contents in a database.
My question is, would I be better off using PHPR, using a free web form creator, or coding this by hand from scratch (definitely my last choice)?
I know this is a little off base, but I value the opinion of the members on this forum. I have yet to be steered in the wrong direction.
Thanks in advance for any feedback.
Dave

J
Jane 2/14/2007

Dave,
as I understand you want to send email in the HTML format.

You can easily integrate HTML emailing using additional command in the mail function.

Here is a sample:

$email="test@test.com";

$message="Hello there
<b>construct your email in the HTML format here</b>";

$subject="Sample subject";
// To send HTML mail, the Content-type header must be set

$headers = 'MIME-Version: 1.0' . "\r";

$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r";
// Additional headers

$headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r";

$headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r";

$headers .= 'Cc: birthdayarchive@example.com' . "\r";

$headers .= 'Bcc: birthdaycheck@example.com' . "\r";
mail($email, $subject, $message,$headers);


Here is the documentation of mail function:

http://www.php.net/manual/en/function.mail.php