Question

i am not able to send email using django in digital ocean

  • Posted on February 1, 2022
  • CuteLapisAnemoneAsked by info

My Code is working fine locally but not on digital ocean…What should I do. Do I have to install anything on droplet for sending mail. I am stuck. Please help me.


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.

Hi there,

In addition to what KFSys already mentioned, what I personally do is to use an SMTP service like SendGrid for example for my outgoing emails.

That way I do not have to manage my own email service on my Droplets and most SMTP providers like SendGrid do offer a free plan which is sufficient for a lot of use cases.

Best,

Bobby

Hey @cutelapisanemone,

Which port are you using to send out e-mails, is it port 25 or 465? If you are using port 25, I’ll recommend using 465 as it’s considered more secure. If however you want to use 25 or you are still having issues with port 465, I’ll recommend contacting DigitalOcean’s Support here:

https://www.digitalocean.com/support/

DigitalOcean blocks traffic on port 25 for new accounts in an effort to prevent spam from leaving their Droplets and worsening the reputation of their IPs. As such contacting them should be enough to have the block on the IP removed, if that’s the case!