Nodemailer times out but it worked before.

Nodemailer times out but it worked before.

Hi, I use the following trnasport settings to send mails programmatically. It worked twice and then stopped by raising a timeout error: Error: queryA ETIMEOUT smtp.zoho.eu
  1. {
      "host": "smtp.zoho.eu",
      "secure": true,
      "port": 465,
      "auth": {
        "user": "mymail@example.com",
        "pass": "app-generated-password"
      }
    }
I tried changing port to 587, secure = false, but nothing changed. And now it keeps giving me timeout even though it worked before and I changed nothing. The firewall hasn't changed.
I tried using openssl as suggested in other topics and it works, it doesn't timeout.

I don't know what to do anymore.

Here's the code:

  1. const transportConfigs = JSON.parse(fs.readFileSync(__dirname + '/mails/transport.json'));
    const mailTransport = mail.createTransport(transportConfigs);

    mailTransport.verify((error, success) => {
        if (error) {
            console.error(`Transport settings NOT verified - ${error}`);
            verified = false;
            return;
        }
        console.log('Transport settings verified');
        verified = true;
    });

    function onFormSubmit(req, res) {
      options = {
        from: `"[STEELGRIM FORM] ${req.body.firstName} ${req.body.lastName}" <${transportConfigs.auth.user}>`,
        to: transportConfigs.auth.user,
        subject: `${req.body.subject} <${req.body.email}>`,
        cc: "",
        text: req.body.message
      };

      console.log(`Sending mail: ${options.from}`);

      mailTransport.sendMail(options, (error, info) => {
        if (error) {
          res.status = 500;
          res.send(error);
          console.error(`Unable to send mail ${options.from}. ${error}`);
        } else {
          res.status = 200;
          res.send(info.response);
          console.log("Mail sent");
        }
      });
Notice that the verify call fails before anything else gets done.
    • Sticky Posts

    • Zoho Mail POP & IMAP Server Details

      Hello all! We have been receiving a number of requests regarding the errors while configuring or using Zoho Mail account in POP/ IMAP clients. The server details vary based on your account type and the Datacenter in which your account is setup. Ensure
    • Important update on Group Management | Zoho Mail

      Dear Zoho Mail Community, This post is to inform you all of the following updates on the Group Management in Zoho Mail. Group Member Addition: If a group member is added to an organization group in a Zoho Application, the member will be automatically
    • Mastering email etiquette and best practices to follow in Zoho Mail

      Hello Zoho Mail Community, We’re thrilled to invite you all to our upcoming webinar: Mastering email etiquette and best practices to follow in Zoho Mail. Join our live webinar for expert etiquette tips to enhance your professionalism and elevate your
    • 📣 📣 ZUG Meetups India - Explore Hybrid Workspaces using Zoho Workplace - Meet and Learn! 🧑🏽‍💻🧑🏽‍💻

      We are excited to announce the User Community initiative to meet you all in person and help you explore the need of the hour - Hybrid Workspaces using Zoho Workplace. We aim to help you to setup your Digital Workplace effectively so that your employees
    • Announcing Zoho Mail - Inactive user Policy

      Dear Zoho Mail users, Thanks to all of you for your continuous support.  We have recently started implementing the Inactive User Policy, for Zoho Mail.  A user is considered as inactive, if the user has not logged in to the Zoho mail account for a period of more than 120 days. The login through POP, IMAP and Active Sync are all taken into account for tracking the period of inactivity.  Whoever received the communication need not panic, as we have just communicated our policy to all the users.  To