Add function to check SMTP status

This commit is contained in:
2020-08-29 18:14:39 +02:00
parent 6a378df5cf
commit 4579be1541
4 changed files with 18 additions and 18 deletions

14
helpers/logSmtpStatus.js Normal file
View File

@@ -0,0 +1,14 @@
const transporter = require('./smtpConfig');
function logSmtpStatus() {
transporter.verify(function (error, success) {
if (error) {
console.log('SMTP is not working, check your configuration.');
return ``;
} else {
console.log('SMTP is correctly configured.');
}
});
}
module.exports = logSmtpStatus;

View File

@@ -1,15 +0,0 @@
const smtpTransporter = require('./smtpTransporter');
function smtpStatus() {
smtpTransporter.verify(function (error, success) {
if (error) {
console.log(error);
return `SMTP is not working, check your configuration.`
} else {
console.log('Server is ready to take our messages');
return `SMTP is correctly configured.`
}
});
}
module.exports = smtpStatus;