Solved

MailMessage AlternateViews HTML Table Cell Colors?

Posted on 2011-03-15
4
472 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Getting error in connectionstring with Excel. 30 67
bound data table problem 2 41
ASP.NET - Why is accordion not working? 3 50
Need help with another query 10 39
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
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…

726 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