Skip to content

NSG.MimeKit.SendGrid.Extensions

Phil Huhn edited this page May 23, 2019 · 1 revision

Table of Contents

Assembly: NSG.MimeKit.SendGrid.Extensions

Namespace: MimeKit

Namespace of MimeKit. MimeKit is an external namespace from the MailKit/MimeKit libraries. This appends to the MimeKit namespace and extends the MimeMessage and BodyBuilder classes.

Class: SendGridExtensions

SendGrid message conversion.


Methods

ConvertToEmailAddress(MailboxAddress)

lambda method to move MimeKit MailboxAddress email address to a new SendGrid EmailAddress address.

Parameters
address

a MailboxAddress email address

Return Value

a new SendGrid EmailAddress address


ConvertToMailboxAddress(SendGrid.Helpers.Mail.EmailAddress)

lambda method to move SendGrid EmailAddress email address to a new MimeKit MailboxAddress address.

Parameters
address

a SendGrid EmailAddress email address

Return Value

a new MimeKit MailboxAddress address


NewMimeMessage(SendGrid.Helpers.Mail.SendGridMessage)

Convert a SendGridMessage mail message, and load it into a new mime message.

For example: This sample shows how to call the NewMimeMessage method.

// translate the message from SendGridMessage to MimeMessage
SendGridMessage _sgm = MailHelper.CreateSingleEmail(_from, _to, _subject, _plainTextContent, null);
MimeMessage _email = SendGridExtensions.NewMailMessage(_sgm);
Parameters
sgm

A SendGrid.Helpers.Mail.SendGridMessage mail message.

Return Value

A new MimeMessage to allow fluent design.