https://github.com/doughtnerd/simple-mailer
https://github.com/doughtnerd/simple-mailer
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/doughtnerd/simple-mailer
- Owner: doughtnerd
- License: mit
- Created: 2017-07-27T20:45:11.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-27T22:26:43.000Z (almost 9 years ago)
- Last Synced: 2025-02-14T03:41:17.757Z (over 1 year ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Simple Mailer
=========
A small library aiming to make sending emails with node a little more streamlined
## Installation
`npm install @doughtnerd/simple-mailer`
## Usage
const mailer = require('simple-mailer');
//Example configs for using GMAIL.
//Check the Nodemailer website for other options
let mailerObject = new mailer.SimpleMailer(
{
service: "gmail",
port:465,
auth: {
user: 'your-email@gmail.com'',
pass: 'YourAPIKey'
},
connectionTimeout :20000,
}
);
const email = new mailer.SimpleMessage();
email.addRecipient('example@test.com');
email.setSubject("Test");
email.setContent("
Hello world
");
mailerObject.sendMessage(email).then((info)=>{
//Do something with the success data if you want...
}).catch((err)=>{
//Catch any errors in sending the message here.
});
## Tests
`npm test`
## Contributing
In lieu of a formal style guide, take care to maintain the existing coding style.
Add unit tests for any new or changed functionality.
Lint and test your code.