Solved

MailMessage AlternateViews HTML Table Cell Colors?

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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

809 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