IOError when trying to send email in Django app

I have a Django app running on a server with uWSGI and nginx.

In my local_settings.py file I have this:

###############
# EMAIL SETUP #
###############
EMAIL_HOST = 'smtp.privateemail.com'
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'MY EMAIL PASSWORD'
EMAIL_PORT = 587
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True


########################
# OTHER EMAIL SETTINGS #
########################
ADMIN_EMAIL = "[email protected]"
SUPPORT_EMAIL = "[email protected]"

When I fill out the /password_reset/ template with an email and submit the form, the email I enter gets no email.

I see these lines in my uwsgi.log file after I submit the password reset form.

Fri May 11 17:48:10 2018 - SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request /password_reset/ (ip 73.49.35.42) !!!
Fri May 11 17:48:10 2018 - uwsgi_response_write_headers_do(): Broken pipe [core/writer.c line 248] during POST /password_reset/ (73.49.35.42)
IOError: write error

What error is this? Why won't the password reset email send?

2 Replies

I'm not really sure -- have you tried using port 465 instead?

Also, is it possible this is failing for a reason other than not sending mail? Is Django able to connect to your database?

Changing the port number got rid of the error.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct