Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jirengu/easymailer
a simple smtp mailer
https://github.com/jirengu/easymailer
Last synced: 4 days ago
JSON representation
a simple smtp mailer
- Host: GitHub
- URL: https://github.com/jirengu/easymailer
- Owner: jirengu
- License: other
- Created: 2015-12-27T08:45:12.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-27T08:45:47.000Z (almost 9 years ago)
- Last Synced: 2024-10-16T11:04:02.120Z (about 1 month ago)
- Language: JavaScript
- Size: 1.26 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# easymailer
a simple smtp mailer base on node mailer
## useage
This is a complete example to send an e-mail with plaintext and HTML body
```javascript
var nodemailer = require("nodemailer");// create reusable transport method (opens pool of SMTP connections)
var smtpTransport = nodemailer.createTransport("SMTP",{
service: "Gmail",
auth: {
user: "[email protected]",
pass: "userpass"
}
});// setup e-mail data with unicode symbols
var mailOptions = {
from: "[email protected]", // sender address
to: "[email protected]", // list of receivers
subject: "Hello ✔", // Subject line
text: "Hello world ✔", // plaintext body
html: "Hello world ✔" // html body
}// send mail with defined transport object
smtpTransport.sendMail(mailOptions, function(error, response){
if(error){
console.log(error);
}else{
console.log("Message sent: " + response.message);
}// if you don't want to use this transport object anymore, uncomment following line
//smtpTransport.close(); // shut down the connection pool, no more messages
});
```