【问题标题】:Error in Django send_mail function?Django send_mail 函数出错?
【发布时间】:2013-01-31 11:41:59
【问题描述】:

我正在尝试使用 Django 文档中的 send_mail:

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

我使用的是真实的电子邮件地址。但是我收到此错误:

send_mail() takes exactly 1 non-keyword argument (4 given)

我做错了什么?谢谢

【问题讨论】:

    标签: django django-email


    【解决方案1】:

    根据 Django 的文档,您的函数调用具有正确的参数。 send_mail(subject, message, from_email, recipient_list, fail_silently=False, auth_user=None, auth_password=None, connection=None)
    您确定您的文件中没有另一个名为 send_mail 的函数吗?

    【讨论】:

    • 哦,我明白了!我不应该将视图命名为 show_file。谢谢老哥!
    猜你喜欢
    • 1970-01-01
    • 2012-03-14
    • 1970-01-01
    • 2016-01-03
    • 2011-06-08
    • 2015-11-12
    • 2011-10-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多