-
Notifications
You must be signed in to change notification settings - Fork 1
Sending basic emails
Max Strålin edited this page Mar 2, 2019
·
1 revision
Sending an email is as simple as passing an IEmailMessage
into an IMailjetEmailClient
.
Simplest way is using the default implementation, EmailMessage
and MailjetEmailClient
, but there's nothing stopping you from passing in any custom IEmailMessage
or using any IMailjetEmailClient
.
IMailjetEmailClient mailjetEmailClient = new MailjetEmailClient(opt => /*Configure public/private key*/);
IEmailMessage emailMessage = new EmailMessage("Sender Name", "Sender Email") {
To = List<EmailEntity> { new EmailEntity("Recipient name", Recipient email") },
HtmlBody = @"<div>Here's some HTML</div>"
}
ISendEmailResponse response = mailjetEmailClient.SendAsync(emailMessage);