我仍在努力弄清楚为什么我无法在自定义电子邮件的正文中应用HTML格式。我确定我漏掉了什么,或者需要一双新的眼睛!
以下是添加到网页
使用Net.Mail发送的邮件。
以下是添加到网页
<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
更新:首先感谢您的评论。邮件本身与样式表没有任何关联。除了附加样式表到电子邮件之外,我还有哪些选项?