Sending email from Django Mezzanine running on Heroku

喜欢而已 提交于 2019-12-13 16:27:43

问题


I am using rackspace email and having problem sending email via Mezzanine(1.4.10) form page. This is my settings:

EMAIL_HOST = 'secure.emailsrvr.com'
EMAIL_PORT = 465    # other ports also tried
EMAIL_USE_TLS = True
EMAIL_HOST_USER = 'info@example.com'
EMAIL_HOST_PASSWORD = 'secret'

This is Rackspace documentation: http://www.rackspace.com/apps/support/portal/1088

But I can send email from the console like this:

from django.core.mail import send_mail

send_mail('Subject here', 'Here is the message.', 'from@example.com',
    ['to@example.com'], fail_silently=False)

It return 1 and I actually got the email. If I do that from Mezzanine, I assumed it also return 1 according the redirect URL after the email was sent, but I don't get the email.


回答1:


In addition to the settings mentioned in the Django documentation, try setting DEFAULT_FROM_EMAIL. You will probably want to use the same value as EMAIL_HOST_USER.



来源:https://stackoverflow.com/questions/18460614/sending-email-from-django-mezzanine-running-on-heroku

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!