Reputation: 17
I am able to send a mail by using send grid API how to send a mail in particular format by using send grid
please find the Mail-format image
Upvotes: 0
Views: 75
Reputation: 2507
Pass in the body as HTML and set the IsBodyHtml = true. I do this using SendGrid.
public Task SendEmailAsync(string email, string subject, string htmlMessage)
{
var client = new SmtpClient(host, port)
{
Credentials = new NetworkCredential(userName, password),
EnableSsl = false
};
return client.SendMailAsync(
new MailMessage(from, email, subject, htmlMessage) { IsBodyHtml = true }
);
}
Upvotes: 0