【问题标题】:im getting that type of error send_mail got multiple values for argument fail_silently [closed]我得到了那种类型的错误 send_mail 得到了参数 fail_silently 的多个值 [关闭]
【发布时间】:2021-08-17 05:02:05
【问题描述】:

我正在编写一个简单的小程序......当我试图通过电子邮件发送此信息时。从那个表格,我得到了那种类型的错误 我正在编写一个简单的小程序......当我试图通过电子邮件发送此信息时。从那个表格,我得到了那种类型的错误

【问题讨论】:

  • 以后,请不要将源代码作为屏幕截图,而应作为格式正确的文本包含在内 - 这使人们更容易为您提供帮助。请参阅 the FAQ 了解其工作原理。

标签: html django forms templates


【解决方案1】:

函数send_mailhas the following signature:

send_mail(
    subject, message, from_email, recipient_list, fail_silently=False, 
    auth_user=None, auth_password=None, connection=None, html_message=None
)

这意味着您的调用等效于以下内容:

send_mail(
    subject='Follow up required for - ' + name,
    message=phone,
    from_email=address,
    recipient_list=message,
    fail_silently=scheldule,
    auth_user=time,
    auth_password=email,
    connection=['fidtestwebsite@gmail.com'],
    fail_silently=False,
)

也许您已经知道出了什么问题 - 您传入参数的顺序很重要。在这里,您将message 作为recipient_list 传递,我猜这不是您的意图,并且错误“send_mail got multiple values for argument fail_silently”来自将scheldule 代替fail_silently 作为@ 987654322@。每个参数只能有一个值。

【讨论】:

  • 这很有帮助??
猜你喜欢
  • 2023-03-15
  • 1970-01-01
  • 2021-10-23
  • 1970-01-01
  • 2022-11-14
  • 2022-08-22
  • 2019-12-30
  • 2022-01-25
  • 2022-01-24
相关资源
最近更新 更多