无法在多部分电子邮件中发送text / plain

时间:2013-05-03 21:16:08

标签: asp.net vb.net email

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

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)

1 个答案:

答案 0 :(得分:0)

我们发现了......代码确实有效。 Gmail用户只需要切换"邮件文字乱码?"让gmail显示纯文本版本。