0

这不能发送文本和 html 多部分电子邮件?但是,用户在 gmail 中看不到文本/纯文本部分?

Dim M As New Net.Mail.MailMessage("someemail@domain.net", Configuration.ConfigurationSettings.AppSettings("Emailvalidation"))
        M.To.Clear()
        M.To.Add(New Net.Mail.MailAddress(TargetEmail, TargetName))
        Select Case SA.Address.Province
            Case "BC"
                M.Bcc.Add(New Net.Mail.MailAddress("bobs email", "bob"))
        End Select
        M.Subject = Subject

        Dim AV2 = Net.Mail.AlternateView.CreateAlternateViewFromString(M2.Body, New Net.Mime.ContentType("text/html"))
        M.AlternateViews.Add(AV2)

        Dim PT As String = PlainTextTemplate
        Dim AV = Net.Mail.AlternateView.CreateAlternateViewFromString(PT, New Net.Mime.ContentType("text/plain"))
        M.AlternateViews.Add(AV)
4

1 回答 1

0

我们想通了……代码确实有效。Gmail 用户只需要切换“邮件文本乱码?” 让 gmail 显示纯文本版本。

于 2013-05-11T04:52:37.660 回答