Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

incoming mail reformat?

Status
Not open for further replies.

kyre

Technical User
Dec 9, 2004
5
US
I have a PHP mail script that gets called from flash. when I receive the email is there a way to add html to dress the way it comes in instead of plain text? or can i use bold/different font sizes? also if a user doesn't type anything into a certain field, can the incoming email that I get not include that item at all? below is the PHP script. for example if I dont enter anything for "bagel" below, can "BAGEL: $bagel" not show up at all in the email that I get?


<?
$ToEmail = 'myemail@myemail.com';

$ToSubject = "subject line here";

$EmailBody = "
COMPANY NAME: $Name\n
ADDRESS: $Address\n
CONTACT PERSON: $ContactPerson\n
\n\n
MENU ORDERS\n
BAGEL: $bagel
TOAST: $toast
FRUIT: $fruit
";

mail($ToName." <".$ToEmail.">",$ToSubject, $EmailBody, "From: ".$Name." <".$Email.">");

?>
 
To answer your question, yes. The mail can be manipulated as it comes in. Look into procmail.

I think a better way is to format it before it leaves. Your script is creating the message; create it the way you want it. For the Bagel example, try something like this:

$EMailbody="COMPANY....";
if ($bagel) $Emailbody.="BAGEL: $bagel\n";
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top