Question

I need some help with sending a formatted email. Below is my code.

I want "Comments:" string to appear in bold. How to do this in vb.net or C#

oBLL.Comments = "Comments:" + txtComments.Text

mailBody.Append(oBLL.Comments)
Was it helpful?

Solution

What you need to do here is build your email body using HTML syntax and set MailMessage.IsBodyHtml property to true before sending.

oBLL.Comments = "<strong>Comments:</strong>" + txtComments.Text;

mailBody.Append(oBLL.Comments);

// ...

// assuming mail client and message instances already exists
mailMessage.IsBodyHtml = true;
mailClient.Send(mailMessage);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top