这不能发送文本和 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)