Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

199
Visualizações
nodemailer timing out when trying to send email

I have this:

app.post('/sendSessionConformationEmail', (req, res) => {
        if (!req.session.loggedin) {
        res.redirect('/login')
        req.session.destroy()
        }
            var email = req.body.email;
            var name = req.body.name;
            var trainername = req.body.trainername;
            var sessionDate = new Date().toLocaleString();
            console.log(email)
            console.log(name)
            console.log(trainername)
            console.log(sessionDate)

            // async..await is not allowed in global scope, must use a wrapper
            async function main() {
            // Generate test SMTP service account from ethereal.email
            // Only needed if you don't have a real mail account for testing
            let testAccount = await nodemailer.createTestAccount();

            // create reusable transporter object using the default SMTP transport
            let transporter = nodemailer.createTransport({
                host: "smtp.gmail.com",
                port: 587,
                secure: false, // true for 465, false for other ports
                auth: {
                    user: "myemail@gmail.com",
                    pass: "myauthpassword",
                },
                tls:{
                    rejectUnauthorized:false
                }
            });

            // send mail with defined transport object
            let info = await transporter.sendMail({
                from: 'my2email@gmail.com', // sender address
                to: "gianluca@my3email.com", // list of receivers
                subject: "Hello ✔", // Subject line
                text: "Hello world?", // plain text body
            });

            console.log("Message sent: %s", info.messageId);
            // Message sent: <b658f8ca-6296-ccf4-8306-87d57a0b4321@example.com>

            // Preview only available when sending through an Ethereal account
            console.log("Preview URL: %s", nodemailer.getTestMessageUrl(info));
            // Preview URL: https://ethereal.email/message/WaQKMgKddxQDoou...
            }

            main().catch(console.error);
    })

I copied the code straight from the nodemailer website, and made the necessary changes. However, when I run this code, nothing sends, and it actually gives me this error:

 Error: connect ETIMEDOUT 13.49.22.0:443
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
  errno: -60,
  code: 'ETIMEDOUT',
  syscall: 'connect',
  address: '13.49.22.0',
  port: 443,
  type: 'FETCH',
  sourceUrl: 'https://api.nodemailer.com/user'
}

I've been using nodemailer with this code for over 2 years, never gotten this error, and it is killing me. Is anyone able to help?

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

ethereal.email (13.49.22.0) is down today. Runs on AWS.

about 4 years ago · Juan Pablo Isaza Relatório

0

you should allow third party apps use your gmail. https://support.google.com/accounts/answer/3466521?hl=en

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda