问题
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