[Answer]-Sending e-mails in django works locally but not online

1👍

If this works locally and you are using the same settings in production, this probably means that your connection from your live server to the smtp server is blocked, or the smtp server is rejecting requests from the IP range that your live server resides in.

Can you ping the SMTP server from the live server? If not, try checking your firewall rules and run a trace to see where the request is being blocked.

If the SMTP server is blocking your IP range (Possible if you are using EC2 or another cloud provider) then you may have to contact the SMTP provider (Microsoft in this case) and have them whitelist your IP.

👤CIGuy

Leave a comment