malcomo
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

Fluent Mailer (All in one Node.js email client)

Usage Guide

Basic Usage

const mailer = Email
    .initialize()
    .from('sergio@email.com')
    .to('chitova@email.com')
    .subject('Hello World')
    .body('Hello World');

await mailer.send()

Mail Providers Integrations

  • [x] SMTP: Send emails using SMTP
  • [x] Mailgun: Send emails using Mailgun API
  • [x] Sendgrid: Send emails using Sendgrid API
  • [x] Mailtrap: Send emails using Mailtrap API

Maily Mailgun

Installation

npm install @fluent-maily/mailgun

Usage

Create an instance of the Mailgun provider

const provider = new MailgunProvider({
    domain: 'your-domain',
    apiKey: 'your-api-key'
});

Sending emails: You can initialize the Email client with the provider instance or set the provider instance after the Email client has been initialized as your default provider.

const result = await Email
    .initialize(provider)
    .from('sergio@email.com')
    .to('chitova@email.com')
    .subject('Hello World')
    .body('Hello World')
    .send();

// OR
Email.setDefaultProvider(provider);

Notes

  • If you would like to create your own email provider checkout the source code, all you need to do is implement the IMailProvider interface and you are good to go.
  • This package is still under development and is not ready for production use.

Package Sidebar

Install

npm i malcomo

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

11.8 kB

Total Files

19

Last publish

Collaborators

  • chitova263