mail.js 352 B

123456789101112131415
  1. const config = require('../config');
  2. const nodemailer = require('nodemailer');
  3. const mailConfig = {
  4. host: config.MAIL_HOST,
  5. port: config.MAIL_PORT,
  6. secure: config.MAIL_SECURE,
  7. auth: {
  8. user: config.MAIL_USER,
  9. pass: config.MAIL_PASSWORD,
  10. },
  11. };
  12. const transporter = nodemailer.createTransport(mailConfig);
  13. module.exports = transporter;