HTML email template loses color in mail

I created a small PHP program that sends a newsletter. This is normal when I view the HTML email template in a web browser. But when sent by mail, it loses all color formatting. Please help! How to send full color email?

Here is the HTML code.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title> Newsletter</title> <style type="text/css"> .AA { font-size: 24px; color: #FFF; } </style> </head> <body> <table width="100%" height="373" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="13%" bgcolor="#336699">&nbsp;</td> <td width="81%" bgcolor="#336699" class="AA"> NEWSLETTER</td> <td width="6%" bgcolor="#336699">&nbsp;</td> </tr> <tr> <td height="252">&nbsp;</td> <td align="left" valign="top">%content%</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td align="center">copyright company</td> <td>&nbsp;</td> </tr> </table> </body> </html> 
+4
source share
1 answer

Use only inline styles; most HTML clients are not advanced enough to understand <style> tags.

Therefore, instead of writing

 <td width="81%" bgcolor="#336699" class="AA"> NEWSLETTER</td> 

Record

 <td width="81%" bgcolor="#336699" style="font-size:24px; color:#FFF;"> NEWSLETTER</td> 

will help.

+4
source

All Articles