send-email
Easily send email using any major email service provider like AWS SES, SendGrid or Gmail
It uses Nodemailer to send email. They've support for several well-known providers
Install
npm install send-email
Environment Variables
SEND_EMAIL_SERVICE_PROVIDER=SES-US-EAST-1
SEND_EMAIL_AUTH_USER=AKIAJLQWEFTYNLFGRQDIG
SEND_EMAIL_AUTH_PASS=Arfk/T8SgGvCtY7Rdq7VOsdjhjDHHOD4F8p36HEWhZl
Usage
const sendEmail = let payload = "to": "test@email.com" "subject": "sending emails using send-email" // "text": "hello world!", "html": "hello <b>world</b>!" "from": "Myself <myself@domain.com>"
Note
If you are using dotenv to set environment variables dynamically then you need to call require('dotenv').config()
before importing send-email.
const dotenv = ;dotenv; const sendEmail =
Since we are using SMTP protocol its little bit slower than using service provider API
Todo
- Credentials in Environment variables & check it
- SES API ?
- Handle Errors properly.
Inspiration
License
MIT © Ashik Nesin