Skip to content

Send emails with FluentEmail via MailerSend using their REST API.

License

Notifications You must be signed in to change notification settings

marcoatribeiro/FluentEmail.MailerSend

Repository files navigation

FluentEmail.MailerSend

Nuget

This library enables you to use Mailersend as a sender for FluentEmail.

Getting Started

Install from NuGet

PM> Install-Package FluentEmail.MailerSend

Basic Usage

Email.DefaultSender = new MailerSendSender("MAILSENDER_API_TOKEN");

var response = await Email
    .From("from@example.com", "Sender Name")
    .To("recipient@example.com")
    .Subject("E-mail subject")
    .Body("Greetings! This message was sent through MailerSend.")
    .SendAsync();

Dependency Injection

public void ConfigureServices(IServiceCollection services)
{
    // ...

    services.AddFluentEmail("from@example.com")
            .AddRazorRenderer()
            .AddMailerSendSender("MAILSENDER_API_TOKEN", options => 
            {
                options.SendAt = DateTime.Now.AddHours(1);
            });

    // ...
}

About

Send emails with FluentEmail via MailerSend using their REST API.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages