I have been trying to send out html emails through a PHP mail script recently. However every time I send the email it changes
from
<html>
<body>
<table bgcolor="red">
<tr><td>How does this look?</td></tr>
</table>
</body>
</html>
to
<html>
<body>
<table bgcolor=\"red\">
<tr><td>How does this look?</td></tr>
</table>
</body>
</html>
How do I prevent this because every time it causes the colors to change between a nasty black and lime green.
Try to escape the quotes, use single quotes, or just remove them (not ideal I know) as your code seems to see those quotes and escape them for you otherwise.
For more information on your issue see addslashes:
http://php.net/manual/en/function.addslashes.php