gpt4 book ai didi

python 3 smtplib sendmail/send_message(mail_options=[], rcpt_options=[])

转载 作者:太空宇宙 更新时间:2023-11-04 03:14:39 25 4
gpt4 key购买 nike

文档指定您可以包含 mail_options=[]rcpt_options=[] 作为 sendmailsend_message< 的参数。我无法在任何地方找到这些选项的确切内容。我假设在那里的某个地方我可以设置 DSN 等。我已经构建了一个运行良好的电子邮件脚本;不需要有关如何使用 Python 进行 smtp 的帮助。

有人知道描述这些选项以及如何使用它们的文档吗?

https://docs.python.org/3.5/library/smtplib.html

https://docs.python.org/3.5/library/email-examples.html#email-examples

最佳答案

如果 SMTP 服务器正确响应“EHLO”命令,则它支持 ESMTP。

8BITMIME —8 bit data transmission, RFC 6152[1]

ATRN —Authenticated TURN for On-Demand Mail Relay, RFC 2645[2]

AUTH —Authenticated SMTP, RFC 4954[3]

CHUNKING —Chunking, RFC 3030[4]

DSN —Delivery status notification, RFC 3461[5]

ETRN —Extended version of remote message queue starting command TURN, RFC
1985[6]
HELP —Supply helpful information, RFC 821[7]

PIPELINING —Command pipelining, RFC 2920[8]

SIZE —Message size declaration, RFC 1870[9]

STARTTLS —Transport layer security, RFC 3207 (2002)[10]
- Not relevant in python3 as it is a separate function

SMTPUTF8 —Allow UTF-8 encoding in mailbox names and header fields, RFC 6531[11]

DSN 用法/语法示例:

smtp.send_message(msg, rcpt_options=['NOTIFY=SUCCESS,DELAY,FAILURE'])

注意事项:

  • ESMTP 规范指出,DSN 可以用字符大小写的任意组合和选项(成功、延迟或失败)的任意组合来指定。
  • DSN 功能取决于从发件人到收件人的每个电子邮件服务器都支持它。

引用资料:

关于 python 3 smtplib sendmail/send_message(mail_options=[], rcpt_options=[]),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36723797/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com