Spirit: Unable to Send Email

I’ve got this in prod_local.py

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'email host'
EMAIL_PORT = 465
EMAIL_HOST_USER = 'name@example.com'
EMAIL_HOST_PASSWORD = 'password'
EMAIL_USE_SSL = True

then I create a send_email_test.py:

import os
from django.core.mail import send_mail

os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings.prod_local'

if __name__ == '__main__':   

    send_mail(
        'hello world',
        'welcome',
        'name@example.com',
        ['anothername@example.com'],
    )

the result is send_email_test.py works fine, which means the mail server functions as expected, but i can’t send email in the forum like ‘reset password’ and ‘send activation email’

please share some ideas to enlighten me thanks

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 22 (11 by maintainers)

Most upvoted comments

i really appreciate your time and kindness

thank you very much

I set task manager to None and it works

I use supervisord to manage it and a systemd service to start it. You can just use a systemd service to keep things simple. Read the docs if you haven’t yet.

You can use SQLite as long as you run everything in a single machine (Spirit web server and the task manager). Your settings are ok if you want that. If you need to run the task manager in its own machine and you have multiple Spirit web servers, then you need to use Redis. The docs explain this well.