Created
July 7, 2022 05:11
-
-
Save somerongit/098c965a0d8d223678fff8970c67ace5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createTransport } from "nodemailer"; | |
async function sendMail( msg: string) { | |
var transporter = createTransport({ | |
service: 'gmail', | |
auth: { | |
user: GetMailUserId(), | |
pass: GetMailPass() | |
} | |
}); | |
var mailOptions = { | |
from: GetMailUserId(), | |
to: (await GetSupervisorMail()).toString(), | |
subject: 'Report', | |
text: msg | |
}; | |
transporter.sendMail(mailOptions, function (error, info) { | |
if (error) { | |
console.error(" sendMail :: Unable to Send Mail to Supervisor \n" + error) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment