Jump to content

PHP/FLASH MAIL FORM


paradrenaline

Recommended Posts

I apologize if this is not the correct place to post, I couldn't find any place related to flash.

 

My problem is this.  I have created a flash form handled by PHP.  When I send mail I would like for some words of a variable to be displayed in bold or underlined in the e-mail.

 

Example of a variable inside my php file

 

$body  = "Dear someone,\n\n";

$body .= "[bOLD]Personal Information\n";  //How can I make only this part of the variable appear bold in the e-mail?

$body .= "Some more text after that";

 

After much research am I correct in thinking that there are no bold or underline tags in PHP.  Do I have to incorporate HTML into this in order to get the desired effect?  If so could someone provide a quick example of how to include HTML in the PHP file.

 

Thanks for your help.

Link to comment
Share on other sites

After much research am I correct in thinking that there are no bold or underline tags in PHP.

 

Yes you are correct. PHP outputs strings. Most people use it to output html.

 

You can easily output (or in your case send) html simply by placing it within the string. eg;

 

$body .= "<b />Personal Information<b />\n";

 

However. To enable an email client to read it as html your will need to add the following to the headers argument of the mail function.

 

"Content-type: text/html\r\n"

 

Link to comment
Share on other sites

to turn my mail into html format I use this in my headers.

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'To: '.$name.' <'.$email.'>' . "\r\n";
$headers .= 'From: $from <$from_email>' . "\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion();

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.