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

0.3.0 • Public • Published

SMTP2GO-Node API Wrapper

This library provides a simple way to send email via the SMTP2GO API and also access other endpoints in the API in a standard way.

Installation

npm i smtp2go-nodejs

Example Code - Sending an Email

import SMTP2GOApi from 'smtp2go-nodejs';

const api = SMTP2GOApi(process.env.APIKEY);

const mailService = api.mail()
    .to({ email: 'to@address.dev',name:"Optional Name" })
    .cc({ email: 'cc@address.dev' })
    .from({ email: 'from@address.dev' })
    .subject('Testing')
    .html(```<h1>Hello World</h1>
    <img src="cid:a-cat"/>
    <p>This is a test html email!</p>```)
    .attach(require('path').resolve(__dirname, './files/test.txt'))
    .inline('a-cat', require('path').resolve(__dirname, './files/cat.jpg'));

api.client().consume(mailService);

Readme

Keywords

Package Sidebar

Install

npm i smtp2go-nodejs

Weekly Downloads

6

Version

0.3.0

License

MIT

Unpacked Size

46.7 kB

Total Files

10

Last publish

Collaborators

  • kris2050