From f850a5dee14a3a13950b1be5c6156ba7f02aac96 Mon Sep 17 00:00:00 2001 From: anbu Date: Tue, 20 Aug 2024 15:47:27 +0530 Subject: [PATCH] email working node with frontlinetech SMTP --- README.md | 1 + myfirst.js | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 README.md create mode 100644 myfirst.js diff --git a/README.md b/README.md new file mode 100644 index 0000000..7149315 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +Great Start \ No newline at end of file diff --git a/myfirst.js b/myfirst.js new file mode 100644 index 0000000..4d8f157 --- /dev/null +++ b/myfirst.js @@ -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); + } +}); \ No newline at end of file