Uname: Linux business55.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
Software: LiteSpeed
PHP version: 8.1.32 [ PHP INFO ] PHP os: Linux
Server Ip: 162.213.251.212
Your Ip: 3.148.235.247
User: allssztx (535) | Group: allssztx (533)
Safe Mode: OFF
Disable Function:
NONE

name : send-mail.js
const nodemailer = require('nodemailer');

const sendMail = async (to, subject, html, cc) => {
    return new Promise(async (resolve, reject) => {
        // Create a nodemailer transporter with the necessary SMTP settings
        const transporter = nodemailer.createTransport({
            host: 'webversesolution.com',
            port: 465,
            secure: true, // Use true if you're using port 465 (SSL)
            auth: {
                user: 'creerlio@webversesolution.com',
                pass: 'MjP0I+Ob5NGP'
            },
            tls: {
                // Do not fail on invalid certs
                rejectUnauthorized: false
            }
        });

        // Construct the email message
        const mailOptions = cc ? {
            from: 'creerlio@webversesolution.com',
            to,
            subject,
            html,
            cc
        } : {
            from: 'creerlio@webversesolution.com',
            to: to,
            subject: subject,
            html: html
        };

        // Send the email
        await transporter.sendMail(mailOptions, (error, info) => {
            if (error) {
                reject(error);
            } else {
                resolve(info);
            }
            // Log the email being sent
            console.log('Sending email to:', to);
        });
    });
};

module.exports = sendMail;
© 2025 GrazzMean-Shell