当使用发送电子邮件的视图什么也没有发生,我然后进入send_mail(...)到python shell,它返回1,但我没有收到任何电子邮件。Django send_mail不起作用
这是我的settings.py
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = '[email protected]'
EMAIL_USE_TLS = True
这是视图:
def send_email(request):
send_mail('Request Callback', 'Here is the message.', '[email protected]',
['[email protected]'], fail_silently=False)
return HttpResponseRedirect('/')
你检查了垃圾邮件收件箱吗?你创建了SPF记录吗? http://support.google.com/a/bin/answer.py?hl=en&answer=33786 – jpic