Karthik Kasula
Karthik Kasula

Reputation: 17

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

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

Upvotes: 0

Views: 75

Answers (1)

Daniel Björk
Daniel Björk

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

Related Questions