Solved

MailMessage AlternateViews HTML Table Cell Colors?

Posted on 2011-03-15
4
466 Views
Last Modified: 2012-05-11
I've used MailMessage & AlternateViews for HTML before, but never with <Table> or <td> colors. The message arrives in table format, but no color.

I replaced the quotes with &quot; which may be the problem (trying to satisfy VS2008 red-squiggles).

stringbuilder.Append(";<table border=&quot;0&quot; width=&quot; 300&quot;  style=&quot; font-family: Arial; font-size: 10px&quot;  >" +
                                "<tr><td width=&quot; 80&quot;  align=&quot; right&quot; >&nbsp;</td><td>&nbsp;</td></tr>" +
                                "<tr><td width=&quot; 80&quot;  align=&quot; right&quot;  bgcolor=&quot; #6699FF&quot; >Count:</td>" +
0
Comment
Question by:pointeman
  • 2
4 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 35141206
Rendering of the email would fall to the client which is displaying the message. You can control the structure of the mail, including what you intend its styling to be, but ultimately, it will be the email client which does or not display color. You'll have to test it.
0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 250 total points
ID: 35141246
P.S.

Try using this instead:
stringbuilder.Append(";<table border=\"0\" width=\"300\" style=\"font-family: Arial; font-size: 10px\" >" +
    "<tr><td width=\"80\" align=\"right\" >&nbsp;</td><td>&nbsp;</td></tr>" +
    "<tr><td width=\"80\" align=\"right\" bgcolor=\"#6699FF\" >Count:</td>"

Open in new window

0
 
LVL 9

Assisted Solution

by:Roman Gherman
Roman Gherman earned 250 total points
ID: 35141249
Hi,
Try:
stringbuilder.Append(
                ";<table border=\"0\" width=\"300\"  style=\"font-family: Arial; font-size: 10px\"  >" +
                "<tr><td width=\"80\"  align=\"right\">&nbsp;</td><td>&nbsp;</td></tr>" +
                "<tr><td width=\"80\"  align=\"right\"  bgcolor=\"#6699FF\" >Count:</td>");

Open in new window


You can find me on: http://extremedev.blogspot.com
0
 

Author Comment

by:pointeman
ID: 35141491
Yea, the email client is certainly the judge. Been working with this code while waiting on EE, using style and single quote, it worked for someone else, we'll see........

stringbuilder.Append(";<table border='0' style='width:300px; font-family: Arial; font-size: 10px;'  >" +
                                "<tr><td style='width:80px; text-align:right; background-color: #6699FF;'>&nbsp;</td><td>&nbsp;</td></tr>" +
                                "<tr><td style='text-align:right; background-color: #6699FF;' >Count:</td>" +
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question