const log = require('../utils/log.utils') const fs = require('fs/promises') const mail = require('nodemailer'); //>> Probs wrong const fromAdrr = process.env.OWL_EML_FROM const smtpUser = process.env.OWL_EML_USER const smtpPass = process.env.OWL_EML_PASS const smtpHost = process.env.OWL_EML_HOST const smtpPort = process.env.OWL_EML_PORT let transporter = mail.createTransport({ host: smtpHost, port: smtpPort, secure: false, // Must be false for STARTTLS on port 587 auth: { user: smtpUser, pass: smtpPass } }) async function sendTest(to, cc, bcc) { log.out(`mailServices.sendTest: Sending test message to: ${to}`, "info") let tHtml = fs.readFile('mail-templates/register.html', 'utf-8'); let tTxt = fs.readFile('mail-templates/register.txt', 'utf-8'); // Send test mail message try { var res = await transporter.sendMail({ from: fromAdrr, to: to, cc: cc, bcc: bcc, subject: "Test Message from OwlBoard", text: (await tTxt).replace(/>>ACCESSCODE<>ACCESSCODE<>ACCESSCODE<>ACCESSCODE<