email working node with frontlinetech SMTP

This commit is contained in:
anbu 2024-08-20 15:47:27 +05:30
commit f850a5dee1
2 changed files with 27 additions and 0 deletions

1
README.md Normal file
View File

@ -0,0 +1 @@
Great Start

26
myfirst.js Normal file
View 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);
}
});