how to send a mail in a particular format by using send grid

77 Views Asked by At

I am able to send a mail by using send grid API how to send a mail in particular format by using send grid

Mail-Format

please find the Mail-format image

1

There are 1 best solutions below

0
On

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 }
    );
}