Nodemailer worked in development but after I deployed it it stopped working

I set environment variables to hide my password and it was working fine in development. I could send emails but when I deployed the website it stopped working. What is the problem?

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.

I am having the same issue with nodemailer except when I uploaded it to heroku, it was still working perfectly. Months passed and then it just stopped working. But still when I run the server on my laptop it can send emails, but when I upload it to heroku or other providers like google clouds it fails to send any emails… so weird. I didnt change anything in the code, and it just stopped working by itself… Have you got any solution what it might be?

Hi @inesbarataborges,

It’s going to be really hard to debug this without any information both for yourself or anyone in the community. Can you try and dig up some logs? Usually, the error_log provides information that 90% of the situations can help with resolving it.

Regards, KFSys