email working node with frontlinetech SMTP
This commit is contained in:
commit
f850a5dee1
26
myfirst.js
Normal file
26
myfirst.js
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
var nodemailer = require('nodemailer');
|
||||||
|
|
||||||
|
var transporter = nodemailer.createTransport({
|
||||||
|
host: "mail.frontlinetech.in",
|
||||||
|
port: 465,
|
||||||
|
secure: true, // upgrade later with STARTTLS
|
||||||
|
auth: {
|
||||||
|
user: "noreply@frontlinetech.in",
|
||||||
|
pass: ")P2g)LLQ%%~U",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
var mailOptions = {
|
||||||
|
from: 'noreply@frontlinetech.in',
|
||||||
|
to: 'sumesh@frontlinetech.in',
|
||||||
|
subject: 'Sending Email using Node.js',
|
||||||
|
text: 'That was easy!'
|
||||||
|
};
|
||||||
|
|
||||||
|
transporter.sendMail(mailOptions, function(error, info){
|
||||||
|
if (error) {
|
||||||
|
console.log(error);
|
||||||
|
} else {
|
||||||
|
console.log('Email sent: ' + info.response);
|
||||||
|
}
|
||||||
|
});
|
||||||
Loading…
Reference in New Issue
Block a user