Skip to content

irbisadm/send-mail

Repository files navigation

Community contributed client for Smtp2Go API

Installation

npm install @irbisadm/send-mail --save
# or
yarn add @irbisadm/send-mail

Usage

The example below shows how to send email with attachments using this library with Smtp2Go provider.

You can sign up for an account at https://www.smtp2go.com/

import {Smtp2Go} from '@irbisadm/mail-sender';

const smtp2Go = new Smtp2Go();
const client = smtp2Go.client({
  key: 'YOUR_SECURE_KEY'
});
const attachments = await Promise.all([
  client.email.readAttachment('./test.pdf','application/pdf'),
  client.email.readAttachment('./test.txt','text/plain'),
])

const sendReport = await client.email.send({
  to: ['Test Person <[email protected]>'],
  sender: 'Test Persons Friend <[email protected]>',
  subject: 'Hello Test Person',
  textBody: `You're my favorite test person ever`,
  htmlBody: `<h1>You're my favorite test person ever</h1>`,
  customHeaders: {
      'Reply-To': 'Actual Person <[email protected]>'
  },
  attachments
});

This package includes community contributed client for Smtp2Go API. It is not officially supported nor created by Smtp2Go.

If you have any problem or question, please, contact contributors of this package at GitHub.

License (MIT)

Copyright 2023 Igor Sheko [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Community contributed client for Smtp2Go API

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published