import nodemailer from "nodemailer"

const user = "1067741001@qq.com";
const pass = "dacfongqfgkubfhd";
const host = "smtp.qq.com";
const port = 587;

export const sendEmail = (to, subject, text) => {
    let transporter = nodemailer.createTransport({
        host: host,
        port: port,
        secure: false,
        auth: {
            user: user,
            pass: pass
        }
    })
    return transporter.sendMail({
        from: user,
        to: to,
        subject: subject,
        text: text
    })
}
