从Heroku发送电子邮件从Django夹层 [英] Sending email from Django Mezzanine running on Heroku
问题描述
我正在使用机架式电子邮件,并通过夹层(1.4.10)表单页面发送电子邮件。
这是我的设置:
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'
这是Rackspace文档:
http://www.rackspace.com/apps/support/portal/1088
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)
它返回1,我实际上收到了电子邮件。如果我从夹层做到这一点,我认为邮件发送后还会根据重定向网址返回1,但是我没有收到电子邮件。
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.
推荐答案
除了Django文档中提到的设置之外,请尝试设置DEFAULT_FROM_EMAIL。您可能希望使用与EMAIL_HOST_USER相同的值。
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.
这篇关于从Heroku发送电子邮件从Django夹层的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!