我仍在试图弄清楚,为什么我不能在自定义电子邮件的正文中应用 HTML 格式。我确定我错过了什么,或者我需要一双新的眼睛!
这是添加到<head>
网页的信息
<head runat="server">
<link href="~/MyStyle.css" rel="stylesheet" type="text/css" />
</head>
Mystyle.css
包含以下内容
span.orange
{
color: #FF6D06;
font-family: tahoma;
font-size: 10pt;
}
身体部位来了……
Dim HtmlString as string = "<span class='orange'>This one should be painted</span>"
使用 Net.Mail 发送
Dim objMail As New Mail.MailMessage (blah, blah blah)
objMail.IsBodyHtml = True
更新:首先感谢您的评论。电子邮件本身不会以任何方式被样式表引用。那么除了将样式表附加到电子邮件之外,我还有哪些选择?