On the Heroku-deployed version of my app, when testing the password reset function, I get the error SMTPServerDisconnected at /accounts/password/reset/ please run connect() first
, this reset functionality works perfectly fine on the local version of my app - I receive the mails from sendgrid without any problems and the app behaves as expected:
my email settings are:
EMAIL_HOST=smtp.sendgrid.net
EMAIL_HOST_USER=apikey
EMAIL_HOST_PASSWORD=*****************************************
EMAIL_PORT=587
EMAIL_USE_TLS=True
my production setup is:
if ENVIRONMENT == 'production':
SECURE_BROWSER_XSS_FILTER = True
X_FRAME_OPTIONS = 'DENY'
SECURE_SSL_REDIRECT = True
SECURE_HSTS_SECONDS = 3600
SECURE_HSTS_INCLUDE_SUBDOMAINS = True
SECURE_HSTS_PRELOAD = True
SECURE_CONTENT_TYPE_NOSNIFF = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
I tried the following (not successfull) solutions: 1.) Setting the SENDGRID_API_KEY at heroku's config variables as suggested here Sending SMTP email with Django and Sendgrid on Heroku
2.) Setting the EMAIL_PORT=456 as according to sendgrid this is the port for SSL connections and I think i have defined that in my production settings
Would be great if anyone has an idea, what to do