반응형
npm i nodemailer
const nodemailer = require('nodemailer');
const MAIL_CONFIG = require('../config/mail-config.json');

const SendMail = async ({
  title = "",
  from = "",
  to = "",
  description = ""
} = {}) => {
  //sending option
  const transporter = nodemailer.createTransport(MAIL_CONFIG);
  //present option
  const result = await transporter.sendMail({
    from, to,
    subject: title,
    html: MakeTemplete(description)
  });
  return result;
}

 

반응형

+ Recent posts