Solved

MailMessage AlternateViews HTML Table Cell Colors?

Posted on 2011-03-15
4
484 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

691 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