Im facing a little trouble when sending emails from ASP.NET (VB). Here is the code Im on
Using mm As New MailMessage("[email protected]", mc.mailTo)
If mc.mailCC.Trim <> "" Then
mm.CC.Add(mc.mailCC)
End If
If mc.mailBCC.Trim <> "" Then
mm.CC.Add(mc.mailBCC)
End If
mm.IsBodyHtml = True
mm.Subject = mc.mailSubject
mm.Body = b
Dim smtp As New SmtpClient()
Try
smtp.Send(mm)
Catch ex As SmtpException
gf.logArray(jA, ex.Message)
Dim statuscode As SmtpStatusCode
statuscode = ex.StatusCode
If statuscode = SmtpStatusCode.MailboxBusy Or statuscode = SmtpStatusCode.MailboxUnavailable Or statuscode = SmtpStatusCode.TransactionFailed Then
System.Threading.Thread.Sleep(5000)
smtp.Send(mm)
End If
End Try
End Using
The issue am having is. The mails are sending fine. but the body is showing as just HTML. Not rendering even I clearly specified mm.isBodyHTML=true. Any suggestions please...
THis is the message I got
I think that the main problem is in you html message body. Try send in message body only table with content, without DOCTYPE, head and other content.
Becouse mail agent render your message in already exist html page, so couldn`t render page in page a agent encode your message body as a string.