Can't send email in droplet with nginx server

I have a contact form in node js application when user submit a form the email will send to Gmail account.i’m using nodemailer to send emails from this application. this is working completely fine in localhost, but in the live server the does not send and I never see any error message.

  • I’m using droplet with nginx server

Please help me to find the solution

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hello there,

It is possible that port 25 is closed. This is something DigitalOcean has been doing to reduce spam on their network. Please do not think that they are accusing you of sending spam, it is more that they simply cannot accurately determine who is going to send it.

Stopping spam is a constant fight, so DigitalOcean has implemented some restrictions on newer accounts. To qualify for the ability to send out emails, DigitalOcean requires accounts to wait 60 days before they can look into removing the restriction. Once your account has reached 60 days of stable use, please do reach back out to the DigitalOcean support team so they can look into this for you.

In the meantime, you could use port 587 instead.

Since a long while, DO is blocking port 25 for email traffic. This, so email servers can’t use your VM as a direct mail relay. You can use port 587 & 465 for mailservers as well.

If this isn’t the case, please post some more information like;

  • Logs
  • Configurations
  • Errors (which you said isn’t there, but there should always be something, somewhere)

Hope this helps you