Page 1 of 1

PHP Question on formatting Form Mail (I'm a rookie)

Posted: Fri Jun 03, 2005 9:10 am
by Asheron
Using the following code how would I
1) bold the $Field (when it's being send in email)
2) make it print more than one field on the same line (could I stick that into a character per line check?)

Code: Select all

<?php 

foreach ($_POST as $Field=>$Value)
   {
	if(!empty($Value)){$MsgBody .= "$Field: $Value\n";} 
   }
?>

Posted: Fri Jun 03, 2005 10:02 am
by pickle
As far as I've researched, you can't bold text unless you go to html emails (which is a bad idea anyway). As for putting multiple fields on 1 line, just remove \n from the end of what you add, and put it in with a particular condition.

Posted: Fri Jun 03, 2005 3:14 pm
by Skara
pickle wrote:...unless you go to html emails (which is a bad idea anyway).
Unless you're just emailing yourself, such as a support ticket. ;)

Instead of bold, just slash words: "If you /really/ like this..." or "I read the book _Whatever_."
:P If that's an option, of course.