View Single Post
  #4 (permalink)  
Old 04-16-2008, 07:54 PM
httpman's Avatar
httpman httpman is offline
WebProWorld Pro
 

Join Date: Aug 2003
Location: France
Posts: 193
httpman RepRank 0
Default Re: (PHP) HTML entities in emails

To translate those entities in their html counterpart, you must send the email as a HTML email, not a TEXT. With PHP mail() function, this is done using the 4th parameter ($more below) :

mail($to,$subject,$mess,$more)

this 4th parameter is used to add any standard e-mail header information, for instance :

$more="From: xxxxxx\n"
."Cc: yyyyyy\n"
. "Bcc: zzzzzz\n"
. "Content-Type: text/html; charset=\"iso-8859-1\"\n";

xxxx, yyy and zzzzz stands for email addresses.
The "content-type" is set to text/html, this will force the email to HTML, and any special hml tag or specialchar will be translated. For instance if you place a <b>xxx</b> in your message, it will appear as xxxx in bold.

The charset depends of the set you are using in your email. 8859-1 is used in Europe, it supports our special characters with those little accents above.

JP
__________________
www.net-createurs.com [ french only website sorry ! ]
Reply With Quote