我是 django 新手,正在尝试使用 django 电子邮件。我在 settings.py 中为邮件提供了以下设置:
EMAIL_USE_TLS = True
EMAIL_HOST='smtp.gmail.com'
EMAIL_HOST_USER='ant@a.com'
EMAIL_HOST_PASSWORD='******'
EMAIL_PORT = 587
我在views.py
下面定义了一个视图:
def testemail(request) :
subject="test email"
message="hello sid"
reply_to_list=['abc@gmail.com','def@gmail.com']
send_mail(subject,message,'ant@a.com',reply_to_list,fail_silently=True)
我已将此视图注册url.py
为:
url(r'^testemail/',email_views.testemail,name="testemail")
但是在点击网址后,我收到以下错误:
send_mail() got an unexpected keyword argument 'fail_silently'
知道为什么我会收到此错误吗?