Hi everyone,
I want to ask about how to render HTML tag and send it to the email body
Is there any best approach doing this?
Thank you
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jaganathan BantheswaranPosted Nov 15, 2013, 12:01 AM
You can do as like this,
MailMessage message = new MailMessage();
message.From = new MailAddress("[email protected]", "from name");
message.Subject = "Email Subject";
message.Body = body; // dynamic html
message.BodyEncoding = Encoding.ASCII;
message.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient("your email server");
smtp.Send(message);