initial commit

This commit is contained in:
Adam 2019-02-05 13:44:51 +00:00
commit 30086d2af8
1 changed files with 27 additions and 0 deletions

27
index.js Normal file
View File

@ -0,0 +1,27 @@
var nodemailer = require('nodemailer');
var transport = nodemailer.createTransport({
host: 'mail.example.com',
port: 465,
secure: true,
auth: {
user: "user@example.com",
pass: "example-password"
}
});
var message = {
from: 'test@example.com',
to: '"Webmaster" <webmaster@example.com>',
subject: 'Nodemailer is unicode friendly ✔',
text: 'Hello to myself!',
};
transport.sendMail(message, function(error){
if(error){
console.log('Error occured');
console.log(error);
return;
}
transport.close();
});