mailjet-apiv3-nodejs icon indicating copy to clipboard operation
mailjet-apiv3-nodejs copied to clipboard

connect ETIMEDOUT 35.187.79.8:443

Open jeremyikwuje opened this issue 1 year ago • 4 comments

I'm trying to send an email using the official TS library, but I keep getting a Timeout error. Here is a sample of my code:

const mailjet = new Mailjet({
    apiKey: config.mailjet.key,
    apiSecret: config.mailjet.secret,
    options: {
        timeout: 50000
    }
});

const request = mailjet
        .post('send', { 
            version: 'v3.1',
        })
        .request({
            Messages: [
                {
                    From: {
                        Email: "[email protected]",
                        Name: "Company"
                    },
                    To: [
                        {
                            Email: "[email protected]",
                            Name: "Jeremy Ikwuje"
                        }
                    ],
                    Subject: "Your email flight plan!",
                    TextPart: "Dear passenger 1, welcome to Mailjet! May the delivery force be with you!",
                    HTMLPart: "<h3>Dear passenger 1, welcome to <a href=\"https://www.mailjet.com/\">Mailjet</a>!</h3><br />May the delivery force be with you!"
                }
            ]
        })

    request
        .then( (result) => {
            console.log(result.body)
        })
        .catch( (err) => {
            console.log(err.statusCode, err)
        })

Need a solution to this.

jeremyikwuje avatar Dec 03 '23 04:12 jeremyikwuje

Came here with the same issue. Have you solved it?

zallesov avatar May 29 '24 15:05 zallesov

No one have a solution for this ?

henri9813 avatar Jul 22 '24 20:07 henri9813

Oh yeah, I did. Just some modifications in the recipient payload.

jeremyikwuje avatar Jul 22 '24 22:07 jeremyikwuje

Hello,

Can you share the modifications ?

Thanks !

henri9813 avatar Aug 07 '24 07:08 henri9813