1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > python发邮件被认定为垃圾邮件_Python:脚本发送的邮件被Gmail标记为垃圾邮件

python发邮件被认定为垃圾邮件_Python:脚本发送的邮件被Gmail标记为垃圾邮件

时间:2022-08-02 02:09:28

相关推荐

python发邮件被认定为垃圾邮件_Python:脚本发送的邮件被Gmail标记为垃圾邮件

我们有一个python脚本,每天将邮件发送到xml地址列表.这些邮件始终被Gmail标记为垃圾邮件.这是代码:email_body = '

@

' text_splited[i] '

@Tr@ces

- unsubscribe'

#text corresponding to that subcription date

# email

msg = MIMEMultipart('alternative') #Create Multipart msg (allows html)

msg['To'] = email.utils.formataddr(('Recipient', 'readers@'))

msg['From'] = email.utils.formataddr(('Traces', 'traces@'))

msg['Subject'] = 'Tr@ces - Part #' str((i 2))

part_html = MIMEText(email_body, 'html')

msg.attach(part_html)

server = smtplib.SMTP('localhost')

server.set_debuglevel(False) # show communication with the server

try:

server.sendmail('traces@', email_addrs, msg.as_string())

finally:

server.quit()

这是生成的电子邮件:Return-path:

Envelope-to: mimmo@

Delivery-date: Wed, 25 Apr 23:59:07 -0600

Received: from localhost ([127.0.0.1] helo=)

by with esmtp (Exim 4.76)

(envelope-from )

id 1SNHjO-0006T0-C2; Wed, 25 Apr 23:59:06 -0600

Content-Type: multipart/alternative;

boundary="===============1468314745133566460=="

MIME-Version: 1.0

To: Recipient

From: Traces

Subject: Tr@ces - Part #9

X-Identified-User: {::andrecas:} {sentby:program running on server}

--===============1468314745133566460==

Content-Type: text/html; charset="us-ascii"

MIME-Version: 1.0

Content-Transfer-Encoding: 7bit

@

Mail content

@Tr@ces

- unsubscribe

--===============1468314745133566460==--

你对此有什么解决方案吗?

谢谢.

解决方法:

您的电子邮件几乎只包含HTML和链接.闻起来像垃圾邮件.

建议:

>发送明文电子邮件(不太可能被视为垃圾邮件 – 对许多用户来说更舒适)

>如果您使用HTML,请始终包含纯文本版本

>改善文本到链接/ HTML比率.来源:/content-1-356151.html

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。