backend/helpers/smtpTransporter.js

26 lines
428 B
JavaScript
Raw Normal View History

2020-08-29 09:01:57 +00:00
const nodemailer = require('nodemailer');
const {
smtpPool,
smtpHost,
smtpPort,
smtpUsername,
smtpPassword,
2020-08-29 12:30:27 +00:00
smtpSecure,
smtpRequireTLS,
2020-08-29 09:01:57 +00:00
} = require('../config/config');
2020-08-29 12:30:27 +00:00
const smtpTransporter = nodemailer.createTransport({
2020-08-29 09:01:57 +00:00
pool: smtpPool,
host: smtpHost,
port: smtpPort,
2020-08-29 12:30:27 +00:00
requireTLS: smtpRequireTLS,
2020-08-29 09:01:57 +00:00
secure: smtpSecure,
auth: {
user: smtpUsername,
pass: smtpPassword,
},
});
2020-08-29 12:30:27 +00:00
module.exports = smtpTransporter;