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

3.0.0 • Public • Published

mailchannels(.js)

[!NOTE]
This SDK is meant for Cloudflare Workers' integration of mailchannels, which doesn't require authentication.

Setup

npm i mailchannels
import { sendMail } from 'mailchannels'

Usage

Add the below TXT records for SPF and Domain Lock to work correctly. Replace WORKER_ID with either

  • your unique subdomain for workers, e.g. username.workers.dev
  • or the (sub)domain you're using for the worker, e.g. example.com.
Name Content
@ v=spf1 a mx include:relay.mailchannels.net ~all
_mailchannels v=mc1 cfid=WORKER_ID
const { success } = await sendMail({
  subject: 'An example',
  message: 'This is an example email sent from Cloudflare Workers.',
  from: {
    name: 'You',
    email: 'you@your.domain'
  },
  to: 'somebody@some.domain'
})

Package Sidebar

Install

npm i mailchannels

Weekly Downloads

4

Version

3.0.0

License

MIT

Unpacked Size

4.65 kB

Total Files

5

Last publish

Collaborators

  • boywithkeyboard