Page 1 of 1

formatting question

Posted: Thu Jun 15, 2006 7:09 pm
by masada
I've got this as a PHP page that a flash movie (contact form) is using to send to email:

Code: Select all

<?PHP 
$to = "myemailaddress@emailaccount.com"; 
$subject = "A message from your site"; 
$message = "Name: " . $theName; 
$message .= "\nEmail: " . $theEmail; 
$message .= "\nGuitar Model: " . $theModel; 
$message .= "\n\nMessage:\n " . $theMessage; 
$headers = "From: $theEmail"; 
$headers .= "\nReply-To: $theEmail"; 

mail($to,$subject,$message,$headers); 

?>

Works fine. But what I'd like to see is the text headers (Name, Email, etc.) that show up in the email to be bold with the imputed text normal. In other words, it would show up in the email as:

Name someone somename
Email something@somewhere.com
etc.

Everytime I drop a <b> </b> in the script it either shows up in the email or it breaks up my code. Any suggestions?

Posted: Thu Jun 15, 2006 7:12 pm
by blacksnday
Send it as html:

Code: Select all

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
reference page for above:
http://us2.php.net/manual/en/function.mail.php

Posted: Thu Jun 15, 2006 7:46 pm
by Christopher
If you look in the online PHP manual there is an example of sending a HTML email that you can use.