tags:

views:

29

answers:

1

Hello friends,

I created a small program in PHP which sends newsletter. It's fine when I preview the HTML email template in a web browser. But when sent in mail it loses all the color formatting. Please help! How would I send an e-mail with full color?

Here's the HTML code.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml"&gt;
<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>
+3  A: 

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

So instead of writing

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

Writing

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

will help.

Aditya Menon