functions/temp.js
// async..await is not allowed in global scope, must use a wrapper
async..await is not allowed in global scope, must use a wrapper
async .. await is not allowed in global scope must use a wrapper
async function main() {
    let transporter = nodemailer.createTransport({
        service: 'gmail',
        auth: {
            user: gmailEmail,
            pass: gmailPassword,
        },
    });
    let info = await transporter.sendMail({
        from: '"nivendhawar2" <nivendhawar2@gmail.com>',
        to: "knivendha@gmail.com", 
        subject: "Hello ✔", //
        text: "Hello world?", 
        html: "<b>Hello world?</b>" 
    });
    console.log("Message sent: %s", info.messageId);
    console.log("Preview URL: %s", nodemailer.getTestMessageUrl(info));
}
async function main ( ) { let transporter = nodemailer . createTransport ( { service : 'gmail' , auth : { user : gmailEmail , pass : gmailPassword , } , } ) ; let info = await transporter . sendMail ( { from : '"nivendhawar2" <nivendhawar2@gmail.com>' , to : "knivendha@gmail.com" , subject : "Hello ✔",  / text : "Hello world?" , html : "<b>Hello world?</b>" } ) ; console . log ( "Message sent: %s" , info . messageId ) ; console . log ( "Preview URL: %s" , nodemailer . getTestMessageUrl ( info ) ) ; }
async..await is not allowed in global scope, must use a wrapper
async .. await is not allowed in global scope must use a wrapper
// Generate test SMTP service account from ethereal.email // Only needed if you don't have a real mail account for testing // create reusable transporter object using the default SMTP transport // send mail with defined transport object // list of receivers  Subject line // plain text body // html body // Message sent: <b658f8ca-6296-ccf4-8306-87d57a0b4321@example.com> // Preview only available when sending through an Ethereal account // Preview URL: https://ethereal.email/message/WaQKMgKddxQDoou...