Reliable Email on Open edX

Probably the most common issue we hear about Open edX installs is that emails are not being received or go to spam over 90% of the time. This is the nature of operating a mail service on your own server: with so much spam on the internet, there are several measures put in place by email services and other providers to prevent spam. Particularly emails from some mail server on a random AWS instance. 

For this reason, it’s advisable to sign up for a reliable email service like Sendgrid or Mandrill, and to configure your email to work with this service. This has the added benefit of being able to see email analytics and use a variety of features that come with these services. 

Here are steps to set this up with your own Open edX instance:

1. Create an account on a services like Sendgrid or Mandrill

2. Obtain the SMTP server details ie server name, username and password.

3. On your Open edX instance, the default email settings will have to be configured to use the SMTP backend provided by yourDjango App instead of the default console backend.

4. These setting variables can be set/modified in following file on your Open edX repo/local instance:
Path:  edx-platform/lms/envs/

5. The suggested changes to variable settings are as follows:

a. There is a setting for EMAIL_BACKEND 
The default setting is:
EMAIL_BACKEND = ‘django.core.mail.backends.smtp.EmailBackend’
This should be changed to: 

EMAIL_BACKEND =django.core.mail.backends.smtp.EmailBackend’

b. There is a setting for EMAIL_HOST
The default setting is usually:
Change this to the SMTP server setting provided by your email provider eg

c. There is a setting for EMAIL_PORT
The default setting is usually
Change appropriate port recommended by your SMTP provider

d. There is a setting for EMAIL_USE_TLS
The default is usually:
Keep the value as 


e. Set the EMAIL_HOST_USER setting to the username from your mail service.
Eg if the email/login of your mail service is, set this value for your EMAIL_HOST_USER

f. Set the EMAIL_HOST_PASSWORD setting to the SMTP password set on your SMTP service
EMAIL_HOST_PASSWORD = ‘setpasswordhere’

g. For the DEFAULT_FROM_EMAIL, set your SMTP email or chosen from email here 

6. Note that you will need to change EMAIL_BACKEND in a couple other places ie
edx-platform/lms/envs/ and edx-platform/lms/envs/ (For your dev environment)

7. An alternate approach is to set/modify the variables in json setting files ie lms.env.json and cms.env.json.
The respective paths on your deployed instance are
 /edx/app/edxapp/lms.env.json and /edx/app/edxapp/cms.env.json

The json settings variables will override the settings sets in

8. After setting the variables restart edxapp and edxapp worker services.
sudo /edx/bin/supervisorctl restart edxapp:
sudo /edx/bin/supervisorctl restart edxapp_worker:

That should do it, you users should now receive email much more reliably!

Here is an example of settings, when Sendgrid is the chosen email provider:

Python common variable file settings:


   EMAIL_BACKEND =  “django.core.mail.backends.smtp.EmailBackend”
   EMAIL_HOST  = “”
   EMAIL_PORT  =  587
   EMAIL_HOST_PASSWORD = “setpasswordhere”
   EMAIL_HOST_USER = “setusernamehere”

JSON file settings:

lms.env.json and cms.env.json:

    “EMAIL_BACKEND”: “django.core.mail.backends.smtp.EmailBackend”, 
    “EMAIL_HOST”: “”, 
    “EMAIL_PORT”: 587, 
    “EMAIL_USE_TLS”: true, 

lms.auth.json and cms.auth.json:

    “EMAIL_HOST_PASSWORD”: “setpasswordhere”,
    “EMAIL_HOST_USER”: “setusernamehere”