Solved

MailMessage AlternateViews HTML Table Cell Colors?

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

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 74

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now