Why SMTP Email does not work with HTML body attached ?
I am developing an ASP.net application and using SMTP email service with GoDaddy. I followed the following link to set up the basic email and worked as expected.
However, when I attach the HTML body to it, do not get any emails.
This is the code I used.
string EmailLoginName = "MyEmail@gmail.com";
MailMessage mailMsg = new MailMessage();
mailMsg.From = new MailAddress(EmailLoginName);
mailMsg.Subject = "Testing godaddy email";
string htmlBody = oEmail.MailBodyDescription;
mailMsg.IsBodyHtml = true;
mailMsg.Body = htmlBody;
SmtpClient client = new SmtpClient();
Any help is appreciated.