import nodemailer , { SentMessageInfo } from "nodemailer" ; import Mail from "nodemailer/lib/mailer" ; const SMTP_SERVER = "smtp-mail.outlook.com" ; const SMTP_PORT = 587 ; const SMTP_AUTH_ACCOUNT = "<your_account>@outlook.com" ; const SMTP_AUTH_PASSWORD = "<your_password>" ; const mailer = nodemailer . createTransport ( { host : SMTP_SERVER , secure : false , port : SMTP_PORT , tls : { ciphers : "SSLv3" } , auth : { user : SMTP_AUTH_ACCOUNT , pass : SMTP_AUTH_PASSWORD } } ) ; export const sendEmail = ( to , subject , content ) : Promise < SentMessageInfo > => { const mailOptions = { to : to , from : SMTP_AUTH_ACCOUNT , subject : subject , text : content } ; return mailer . sendMail ( mailOptions ) ; } ;