This library enables you to use Mailersend as a sender for FluentEmail (fork from @jcamp-code).
Install from NuGet
PM> Install-Package FluentEmail.MailerSend
Email.DefaultSender = new MailerSendSender("MAILSENDER_API_TOKEN");
var response = await Email
.From("[email protected]", "Sender Name")
.To("[email protected]")
.Subject("E-mail subject")
.Body("Greetings! This message was sent through MailerSend.")
.SendAsync();
public void ConfigureServices(IServiceCollection services)
{
// ...
services.AddFluentEmail("[email protected]")
.AddRazorRenderer()
.AddMailerSendSender("MAILSENDER_API_TOKEN", options =>
{
options.SendAt = DateTime.Now.AddHours(1);
});
// ...
}