I made script that sends html email messages to users. However, in Gmail, I can’t seem to get the font color working. It works for the first message, but the next messages in the conversation are all displayed in purple.
It only happens when I get the strings from .txt files using file_get_Contents()). If I fill the variables with strings from within my class or enter the message directly rather than using variables gmail displays the html normally. I haven’t found any problems with other webmail or mail clients. For the actual sending of the mail I tried both phpmailer and the regular mail() function.
$message = "<html><body><font face='Georgia, Times' color='red'>";
$message .= "<p>Beste " . $this->name . "</p>";
$message .= "<p>" . $parPersonal . "</p>";
$message .= "<p>" . $parOne . "</p>";
$message .= "<p>" . $parTwo . "</p>";
$message .= "<p>" . $parThree . "</p></font></body></html>";
A screenshot from gmail:

On a side note, this script will usually only send 1 email to 1 person at a time and this problem shouldn’t appear, it is currently just mailing to my own gmail account for testing purposes. However, I’m extremely curious how I can fix this for future purposes.
Most likely this is due to the improper nesting of the
<font>tag.The
<font>tag is an inline element, which should be nested inside your block elements such as the<p>tags.This leads to very messy HTML, but such is the lot with the rather archaic html engines used by email clients.
You can get good coverage these days using inline styles in your elements (but separate
<style>blocks are still poorly covered). See this great resource from CampaignMonitor for what you can use : http://www.campaignmonitor.com/css/