Spring Boot email works with Gmail but fails with OVH SMTP server

I have a Spring Boot application that needs to send emails. When I test it locally using Gmail SMTP settings, everything works perfectly and emails are delivered without any problems.

However, when I switch to my OVH email configuration (I have a custom domain and email service through OVH), the application runs without throwing any errors, but the emails never reach their destination. The sending process appears to complete successfully, but recipients never receive the messages.

What could be causing this issue with OVH email service? Are there any specific settings or troubleshooting steps I should check?

Here’s my current email configuration:

spring:
  mail:
    host: ssl0.ovh.net
    port: 587
    username: [email protected]
    password: mypassword
    properties:
      mail:
        transport.protocol: smtp
        smtp:
          auth: true
          starttls:
            enable: true
            required: true
    test-connection: true

Any suggestions would be helpful!

ovh smtp’s a pain. switch to port 465 with ssl - ditch starttls. ur from address needs to match your auth credentials exactly, they’re super picky about that. check ur ovh logs too, they’ll block outgoing mail without warning you.

First, check your OVH email quotas and sending limits. Most hosts like OVH have daily sending caps that aren’t obvious. I hit this exact issue - my app worked fine but emails got queued or dropped silently when I maxed out the hourly limit. Also check if your server’s IP is blacklisted using RBL databases. OVH sometimes gives you shared IPs with bad reputations. Try sending a test email through OVH’s webmail with the same from/to addresses to see if the account works. If that doesn’t work, you might have authentication problems in your OVH control panel setup.

Had the same problem switching from Gmail to OVH SMTP. Your config looks right, but OVH has some weird quirks that’ll silently kill your emails. First, check if SMTP is actually turned on in your webmail settings; it’s often disabled by default. Second, try using your full email address as the username, not just the part before the @. Third, log into your OVH control panel and look for IP restrictions or security settings blocking your app. I’d also throw mail.debug=true in there to see what’s actually happening in the SMTP conversation. OVH’s spam filters are brutal too; your emails might just be getting dropped instead of bouncing back.