0

I was working on django and everthing was working fine on my local machine as well as on heroku.

But than i deodorize my django project and it was working fine locally till now. now i have depolyed this container on my dedicated server and than i came to know that my emails was failing after deployment.

Can anybody have idea why my dedicated server is not sending mails?

I am sending mails using smtp protocol.

Any help or suggestion will be highly appreciated.

Thanks.

1

1 Answer 1

1

I'm assuming you're connecting to your local SMTP server to send out those emails.

The problem is that your Django is trying to use localhost:25 to send out the emails and in your docker there's no SMTP server. Docker has it's own network, and you can see what are the interfaces available by executing

ifconfig

To solve your issue, you should tell django to use your host SMTP server (and not localhost). Moreover you should tell your local SMTP server to accept emails coming from the docker network.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.