Page 1 of 1
Help with a problem?
Posted: Sun Dec 10, 2006 2:26 pm
by darkfreaks
hey,
i have a problem with my email contact form i want the message im sending which is in html to show as html but when it sends it shows as plain text and you can see alll the html tags
any fixes to this problem?
Posted: Sun Dec 10, 2006 2:36 pm
by feyd
Set the content type to text/html in the headers.
Posted: Sun Dec 10, 2006 3:13 pm
by darkfreaks
this is the email i get after i put the headers in but it still shows html tags when sent
:
Code: Select all
[syntax=php]order fromBryceMIME-Version: 1.0Content-Type: multipart/alternative; boundary = HTMLDEMO457c77a08d011 This is a MIME encoded message. --HTMLDEMO457c77a08d011Content-Type: text/html; charset=ISO-8859-1Content-Transfer-Encoding: base64 VGhpcyB0aGUgPGI+SFRNTDwvYj4gdmVyc2lvbiE= <b><center><font face="arial" size="3" color="white">Bryce has ordered the following items:</center> <center><table border="1" bordercolor="white"> <tr><td>Necklace:</td><td> Length</td><td> Pattern</td><td> Bead Color</td><td> Bead Size</td><td> Chain Size</td><td>Bead Type</td><td>Quantity</td><td>Subtotal:</td></tr> <tr><td>Necklace of the Night Sky:</td><td>6</td><td>bead</td<td>Red</td><td>6mm</td><td>Large</td><td>Glass</td><td> 4 </td><td>$200</tr> <tr><td>Chainmaile Beaded FancyNecklace:</td><td>20</td><td>bead</td><td>Red</td><td>6mm</td><td>Large</td><td>Glass</td><td>11</td><td>$550</td></tr> <tr><td>Antique Key Necklace:</td><td></td><td>bead</td><td>Red</td><td>6mm</td><td>Large</td><td>Glass</td><td>12</td><td>$360</td></tr> <tr><td>Chainmaile Fancy Necklace:</td><td>24</td><td>bead</td><td>Red</td><td>6mm</td><td>Large</td><td>Glass</td><td>12</td><td>$600</td></tr> <tr><td>Chainmaile V Necklace:</td><td>25</td><td>bead</td><td>Red</td><td>6mm</td><td>Large</td><td>Glass</td><td>19</td><td>$950</td></tr> <tr><td colspan="9"><hr></td></tr><tr><td>Total:</td><td></td><td></td><td></td><td></td><td></td><td>58</td><td>$2660</td></tr> </font></table></center>
[/syntax]
Posted: Sun Dec 10, 2006 3:42 pm
by darkfreaks
also Order from: (name here) is suposed to show in the subject not the message and now the subject has become nobody@ localserver.com ???
Posted: Sun Dec 10, 2006 3:52 pm
by Burrito
what does the header look like you're sending to identify it as HTML.
it should be something like this:
Content-Type: text/html;
Posted: Sun Dec 10, 2006 3:52 pm
by feyd
What code did you use?
Posted: Sun Dec 10, 2006 3:55 pm
by darkfreaks
Code: Select all
[syntax=php]//specify MIME version 1.0
$headers .= "MIME-Version: 1.0\r\n";
//unique boundary
$boundary = uniqid("HTMLDEMO");
//tell e-mail client this e-mail contains//alternate versions
$headers .= "Content-Type: multipart/alternative" .
"; boundary = $boundary\r\n\r\n";
//message to people with clients who don't
//understand MIME
$headers .= "This is a MIME encoded message.\r\n\r\n";
//HTML version of message
$headers .= "--$boundary\r\n" .
"Content-Type: text/html; charset=ISO-8859-1\r\n" .
"Content-Transfer-Encoding: base64\r\n\r\n";
$headers .= chunk_split(base64_encode("This the <b>HTML</b> version!"));
[/syntax]
please tell me if there is anything wrong with this code or needs ot be changed in anyway so it actually works.

Posted: Sun Dec 10, 2006 5:29 pm
by darkfreaks
please lock this topic i got the headers to work correctly
