小编Dro*_*Av.的帖子

Python-发送电子邮件时出错(拒绝中继访问)

尝试使用python sendmail发送电子邮件时出现错误。这是我的python代码:(Pas d'objet)

#! /usr/bin/python

import smtplib

from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText

# me == my email address
# you == recipient's email address
me = "my@email.com"
you = "email@gmail.com"

# Create message container - the correct MIME type is multipart/alternative.
msg = MIMEMultipart('alternative')
msg['Subject'] = "Link"
msg['From'] = me
msg['To'] = you

# Create the body of the message (a plain-text and an HTML version).
text = "Hi!\nHow are you?\nHere is the link you wanted:\nhttp://www.python.org"
html …
Run Code Online (Sandbox Code Playgroud)

python email smtp

8
推荐指数
1
解决办法
2086
查看次数

标签 统计

email ×1

python ×1

smtp ×1