• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

How to send HTML with PHP mail??

nag

New Member
I want to know How to send HTML enabled mail through PHP's mail() function as if i would try this to send HTML by putting it in mail() function it would certainly give error as it may contain other symbols like
Code:
 <>;" etc
so PHP would try to interpret in its own way so how I can assign it to variable and then put the name of variable in mail() function like
PHP:
$myvar="<h1><font color="red">Good </font></h1>";
mail("to@someone","subject",$myvar,"header");
But here is the problem as when i would assign value in which way i can assign
Code:
<font color="red">
because it had quotes ...Any help??:confused: :confused:
 
Escape the quotes with backslashes, "<font color=\"red\">" for example. I don't know if PHP will use the correct header or if you have to force it to use text/html, you'll probably have to specify "Content-type: text/html;" in the header argument.
 
Back
Top