How to setup smtp email in production

I have installed juniper.master on aws following the instructions in this blog: https://blog.lawrencemcdaniel.com/open-edx-installation/
Everything is up and running,except for the email sending.
I am not getting emails during signup and reset password.
What I’ve done:

  1. Edited the following properties inside lms.env.json and cms.env.json files, and set my email adress where emails are required( eg:- “DEFAULT_FEEDBACK_EMAIL”: “myaccount@gmail.com”,)

    “EMAIL_BACKEND”: “django.core.mail.backends.smtp.EmailBackend”,
    “EMAIL_HOST”: “smtp.gmail.com”,
    “EMAIL_PORT”: 587,
    “EMAIL_USE_TLS”: true,
  2. Edited the following properties inside lms.auth.json and cms.auth.json files
    “EMAIL_HOST_PASSWORD”: “emailpassword”,
    “EMAIL_HOST_USER”: “myaccount@gmail.com”,
  3. I restarted open edx
    /edx/bin/supervisorctl restart lms
    /edx/bin/supervisorctl restart cms
    /edx/bin/supervisorctl restart edxapp_worker:

Am i missing something here?
Thanks in advance for your help!

This issue was resolved by editing the same properties inside /edx/etc/lms.yml file

1 Like

But the activation email is providing a broken account activation link that points to “http://localhost”.
In my configuration file in /edx/app/edxapp/lms.env.json, as well edx/etc/lms.yml , I have these

“LMS_BASE”: “www.domain.com”,
“LMS_INTERNAL_ROOT_URL”: “www.domain.com”,
“LMS_ROOT_URL”: “www.domain.com”,

Any ideas?

Thanks in advance!

2 options:

1- in your site_configuration, in LMS Django Admin, check that you have “lms_root_url”:“http://www.domain.com , and edit the file “lms/templates/emails/activation_email.txt”, change “lms_url” by “lms_root_url

2- just go and edit the file “lms/templates/emails/activation_email.txt”, change “lms_url” by “LMS_ROOT_URL

Restart all services, and try again.

That’s how i fixed it.

Regards,

1 Like

Thanks @Herve_siyou . site name was not filled on lms.env.json and cms.env.json files.When I correct that, the problem was fixed.
Your solutions are also correct.

1 Like

(for JUNIPER release)
Edited the following properties inside /edx/etc/lms.yml and /edx/etc/studio.yml
(Used AWS SES for email)

“DEFAULT_FROM_EMAIL”: “myaccount@gmail.com”,
“EMAIL_BACKEND”: “django.core.mail.backends.smtp.EmailBackend”,
“EMAIL_HOST”: “smtp.gmail.com”,
“EMAIL_PORT”: 587,
“EMAIL_USE_TLS”: true,
“EMAIL_HOST_PASSWORD”: “emailpassword”,
“EMAIL_HOST_USER”: “myaccount@gmail.com”,

Restarted open edx -
/edx/bin/supervisorctl restart lms cms edxapp_worker: