Early to do an automatic e-mail program, has always been found that the notes after the upgrade instead of CSS styles are not.
At first, the format of data in the, the customer did not say anything, and later felt such an attitude is not good, small holes do not fill, big hole hardship.
So check the data, found that the browser shows that the normal CSS in the mail client may not be normal display, it seems I recruit.
e-mail program about seven, only one CSS style is normal, so take it and the other six contrast. Combined with online data, it is found to be caused by the following reasons:
1. The HTML code in the message does not support the short CSS format and requires a line of writing.
2. The HTML code in the message does not support the TR style, if the interval color is required, the emphasis color needs to be set to TD.
After the modification, the new style was born:
Sb.append ("<style type=\" text/css\ ">"); Sb.append ("Body {"); Sb.append ("Margin:5px auto;"); Sb.append ("Font-family:arial;"); Sb.append ("FONT-SIZE:14PX;"); Sb.append ("Color: #444;"); Sb.append ("}"); Sb.append ("Table{"); Sb.append ("margin:0px;"); Sb.append ("Text-align:left;"); Sb.append ("} "); Sb.append ("Table caption{"); Sb.append ("Text-align:center;"); Sb.append ("} "); Sb.append ("Table th{"); Sb.append ("Background-color: #989898;"); Sb.append ("Color: #ffffff;"); Sb.append ("Text-align:center;"); Sb.append ("Padding:7px 10px;"); Sb.append ("Border-bottom:solid 1px #d2d1cb;"); Sb.append ("}"); Sb.append ("Table TR td{"); Sb.append ("Background: #fbfcfc; "); Sb.append ("Border-bottom:solid 1px #e0e0e0;"); Sb.append ("Padding:8px 10px;"); Sb.append ("}"); Sb.append ("Table TR td.odd{"); Sb.append ("Background: #f8f8f8;"); Sb.append ("}"); Sb.append ("Table TR td.aqua{"); Sb.append ("Background: #ccffcc;"); Sb.append ("}"); Sb.append ("Table TR td.error{"); Sb.append ("Background: #fdbf9a;"); Sb.append ("}"); Sb.append ("</style>");
The display effect is much worse than the version of the subscription that was debugged in the Web page, but the one in notes has no style like plain text, which is consistent in notes and Web pages.
Remember an issue with HTML-formatted mail