EmailJS and SMTP error

Hello, for many months I’ve been using EmailJS with an OVH email address on a contact form on a website hosted by OVH.

Everything worked perfectly, but for the past week the requests no longer succeed, returning an SMTP error code 412 Connection timeout.

Sending emails with Thunderbird or other clients works, but not with EmailJS. Moreover I have another email address linked to EmailJS that works, so the problem is not the service but OVH.

In my OVH control panel, the address used is not “Blocked for SPAM”, there should be between 1 and 3 emails sent per month.

Has OVH blocked automated email sending with EmailJS (or others)?

Has anyone experienced a similar problem?

Thanks for your help.

Hello,

Either you are using an anonymous send via 'sendmail' or PHP mail(), each email sent is deducted in your client area under Hosting > ... > Email Scripts. Check whether the service is active and not blocked. Blocking occurs when there is an abnormal error bounce rate.

Or you are using SMTP, could you in this case specify here the name of the SMTP server you are using, the port number, and the connection type.

Hi @cddev

Yes, that error indicates that EmailJS is trying to connect to OVH's SMTP server, but the connection doesn't complete.

It could be due to several reasons, including a preventive block or spam on OVH's infrastructure. If it's something on their side, they should provide a solution shortly. Still, I'd recommend you check your EmailJS configuration.

Try using the server smtp.mail.ovh.net instead of ssl0.ovh.net, as this variant sometimes helps resolve connection issues:

  • Port 465 :right_arrow: Security SSL/TLS (the most common and recommended option for ssl0.ovh.net).
  • Port 587 :right_arrow: Security STARTTLS. Although valid, OVH suggests that 465 may work better for some scripts.

Make sure the connection is using at least TLS 1.2

Let us know :wink:
Sergio Turpín

Thank you for your answers.

I use SMTP sending, and I have tried all possible configurations:

Host: smtp.mail.ovh.net or ssl0.ovh.net

Port: 465 or 587

SSL: Enabled or Disabled

Correct username and password.

I even tried with another OVH email address that I just created, with a different domain name so it shouldn’t be marked as spam, and I have the same problem.

What surprises me is that everything worked perfectly for more than a year, and overnight I get this error even though the configuration is correct. Hence my question about a possible blockage from OVH.

Additional information: I am on the MX Plan, DKIM is enabled on the domain.

Hi @cddev

That the problem appeared overnight and with another email address clearly points to a blockage or change in the SMTP configuration of OVH.

Open a support ticket so they can clarify what’s happening and give you a solution.

Kind regards,
Sergio Turpín

Please specify whether this error code occurs in your application, or whether an email is sent and returned with this error message.

I ask this because an application that tries to contact an unavailable SMTP server would only get a connection error, such as a timeout, but not a 412 error.

Receiving a 412 means that we have a connection with a server that returns this error.

It's the app that returns this error, the email is never sent.

I'm going to contact support and see what they tell me.

Do you have the context of this error? Does it appear on the user’s screen? Or in a log file?

Is “412 Connection timeout” an error message expected by your application? If not, this 412 code was indeed generated by the SMTP server...

Is there no more detailed explanation like “Timeout opening … (server name, IP address, …)”?

The error appears in the EmailJS service logs, but the user does not see this error.

There is no other information, aside from the error code. EmailJS works in an extremely simple way; it is a basic service that avoids having to manage a backend server for automatic email sending.

I contacted support, and they told me it was related to my MX Plan offering that runs on shared hosting:

Indeed, shared hosting runs on a cluster shared by several thousand customers. SMTP connections initiated from this type of hosting use a common outbound IP address. However, MX Plan offers are subject to a limitation of 300 emails per hour per IP address. This limitation, applying to the IP address used for sending, can be reached quickly when multiple hostings in the same cluster simultaneously send via the MX Plan SMTP server.

But this response is not valid because I can still send emails with Thunderbird or OVH’s webmail when the automatic sending does not work.

But you didn’t understand that the IP address of cluster102 is not the same as that of your PC at home.

Nevertheless, I think support is wrong and that OVH has whitelisted the clusters so they are not limited in the number of sends per hour. Even if this situation may have existed in the past, it would be intolerable to see your transactional sends rejected because other users of the same cluster have actually sent mails during the preceding hour.

Unfortunately OVH documents this very poorly.

Except that you didn't understand that the IP address of cluster102 is not the same as your home PC's.

Sorry, I'm not an expert on anything related to mail / mail servers etc. But for me the source point of the SMTP connection comes from the EmailJS servers, not from my shared hosting or my computer.

The only solution I see is to abandon using OVH mail for automatic email sending with the service I use. It's a shame, it was very convenient and it worked for almost 2 years without any problems, and moreover it was a 100 % free solution.

Thanks sturpin and fritz2cat for your help.

Hello @cddev

What CMS are you using? I mention it because you could maybe use a plugin and avoid the EmailJS service.

Hope to hear from you :wink:

Hi sturpin,

I don't use a CMS; the site is built with vanilla technologies (HTML/CSS/JS), which is why I'm using a service like EmailJS since there's no backend/no PHP. For now I'm just going to use another email address, while I look for possibly another free service or even go straight to a personal backend.

I'm starting to understand that emailJS is not a JavaScript library for sending e‑mails from your OVH hosting, but rather from servers owned by emailjs.com

So it becomes virtually certain that OVH has temporarily (or permanently) blacklisted the IP addresses of emailjs.com, especially if there have been mail campaigns that could have been regarded as abuse.

Realize that we are at about a dozen messages because the original question was incomplete. We can't guess every individual situation.

Take a look at this :backhand_index_pointing_down:

These two I mentioned above are very similar to EmailJS (so I have a feeling you might get the same error), but just to try...

Additionally you could also try some transactional email service:

  • https://resend.com/ (they usually allow 3000 emails/month free)
  • Brevo also has an API that allows 300 messages per day and they provide a very good REST API.

You also have serverless backend services, but I think that adds complexity to your web development.

Let us know :slightly_smiling_face:
Sergio Turpín

So that’s exactly what I thought, it’s OVH that started blocking EmailJS servers.

So the solution is to avoid using an OVH email address with the EmailJS service or to switch to another service for automatic email sending like the ones offered by sturpin:

Problem solved, thanks for your help :slight_smile:

I’m glad you solved it, cheers :wink: