Pergunta

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

Solução

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 em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top