'Nodemailer ae not working with EC2 instance

var transporter = nodemailer.createTransport({
    service: 'gmail',
    host: 'smtp.gmail.com',
    auth: {
        user: process.env.COMPANY_EMAIL_ID,
        pass: process.env.COMPANY_EMAIL_PASSWORD
    }
});


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source