使用Tiny MCE,但电子邮件没有发送格式化?

时间:2011-06-08 09:35:12

标签: asp.net vb.net tinymce

我在文本框中使用小型mce并尝试发送电子邮件。

    <asp:TextBox ID="txtBody" runat="server" Rows="10" class="tinymce"
                                TextMode="MultiLine" Width="100%"></asp:TextBox>

但发送的电子邮件未格式化..

<p><span style="background-color: #ff0000;">hello</span></p&GT;

它不应该说那么多吗?你好红色背景吗?

   Sub SendEmail(ByVal sEmailAddressFrom As String, ByVal sEmailAddressTo As String, ByVal sSubject As String, ByVal sBody As String)
    Dim msg As New MailMessage
    msg.To = sEmailAddressTo
    msg.From = sEmailAddressFrom
    msg.Body = sBody
    msg.Subject = sSubject
    Mail.SmtpMail.SmtpServer = "127.0.0.1"
    SmtpMail.Send(msg)
End Sub

1 个答案:

答案 0 :(得分:3)

好吧,我怀疑......

将以下内容添加到您的代码中,它应该可以正常运行...

Sub SendEmail(ByVal sEmailAddressFrom As String, ByVal sEmailAddressTo As String, ByVal sSubject As String, ByVal sBody As String)
    Dim msg As New MailMessage
    msg.To = sEmailAddressTo
    msg.From = sEmailAddressFrom
    msg.Body = sBody
    msg.IsBodyHtml = True 'New Line here
    msg.Subject = sSubject
    Mail.SmtpMail.SmtpServer = "127.0.0.1"
    SmtpMail.Send(msg)
End Sub