html在outlook中不正确

时间:2016-10-14 11:38:52

标签: c# html outlook gmail

Html电子邮件在Outlook中无法正常显示,但在gmail中正常运行。我该怎么办?

前景有一个设计中断..

这是html代码:

strEmailBody = strEmailBody + " <table id=\"table_banner\" cellspacing=\"10\" cellpadding=\"0\" width=\"100%\" align=\"left\" bgcolor=\"#09355A\" border=\"0\"  style=\"padding-bottom: 8px;    margin-bottom: 12px;\">";
strEmailBody = strEmailBody + "<tr><td >";

strEmailBody = strEmailBody + "<span style=\"font-family: Arial,Helvetica,sans-serif;font-size: 52px;color:white;\"><strong>Family</strong>Connect<sup style=\"font-size: 20px;\">®</sup></span>";
//strEmailBody = strEmailBody + "<span style=\"FONT-SIZE: 10PX;FONT-WEIGHT: BOLD;vertical-align: text-top; bottom: 1ex;color:white;position:relative; bottom: 2.3em;\">TM</span>";
strEmailBody = strEmailBody + " <p style=\"border-bottom: 3px solid #ee7701;border-bottom-color: #ee7701;margin-bottom: 10px;margin-top: 4px;\"></p> ";

strEmailBody = strEmailBody + "<span style=\"font-size: 15px;font-family: Arial,Helvetica,sans-serif; color:white;\">For parents of children with visual impairments </span>";
strEmailBody = strEmailBody + "</td></tr>";
strEmailBody = strEmailBody + "</table>";

strEmailBody = strEmailBody + "<br><br>A new Blog Entry has been posted on the \"" + strBlogName + "\":  <br><br>";


strEmailBody = strEmailBody + " <br><br><p>You are receiving this message because you signed up to receive e-mail alerts whenever there is new activity on this blog. You can ";
strEmailBody = strEmailBody + "the " + strUnsubscribeLink + "unsubscribe" + "</a>" + "  at any time. ";
strEmailBody = strEmailBody + " This email was delivered to you by the American Foundation for the Blind. Replies to this email address cannot be answered. For questions/concerns email us at <a href=\"mailto:afbweb@afb.net\">afbweb@afb.net</a>.</p>";

Email in Outlook

上面是outlook的照片。

Email in Gmail

no.2 image for gmail ..

我该怎么做???

1 个答案:

答案 0 :(得分:0)

您使用什么来发送电子邮件? 如果您使用的是MailMessage,是否将IsBodyHtml设置为true?

MailMessage mm = md.CreateMailMessage(mailTo, ld, new Control());
mm.IsBodyHtml = true;