Pregunta

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)
¿Fue útil?

Solución

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);
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top