Add function to check SMTP status

This commit is contained in:
ruihildt committed 2020-08-29 18:14:39 +02:00
1 parent 6a378df5cf
commit 4579be1541
4 files changed
+18 -18

No files matched your search

+14
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;
File renamed without changes.
-15
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;