Skip to content

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("[email protected]", "Sender Name")
    .To("[email protected]")
    .Subject("E-mail subject")
    .Body("Greetings! This message was sent through MailerSend.")
    .SendAsync();

Dependency Injection

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

    services.AddFluentEmail("[email protected]")
            .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