相关疑难解决方法(0)

如何在通过smtplib发送电子邮件时在电子邮件内容中添加href链接

我通过以下代码发送电子邮件:

msg = MIMEText(u'<a href="www.google.com">abc</a>')
msg['Subject'] = 'subject'
msg['From'] = 'xxx'
msg['To'] = 'xxx'

s = smtplib.SMTP(xxx, 25)
s.sendmail(xxx, xxx, msg.as_string())
Run Code Online (Sandbox Code Playgroud)

我想要收到的是

ABC

我实际收到的是:

<a href="www.google.com">abc</a>
Run Code Online (Sandbox Code Playgroud)

python email smtp smtplib

11
推荐指数
2
解决办法
9852
查看次数

标签 统计

email ×1

python ×1

smtp ×1

smtplib ×1