小编Imi*_*Iik的帖子

Python在代理服务器后面发送电子邮件

我想通过hotmail smtp使用python脚本发送电子邮件,但我已连接到代理服务器.

有我的代码,当它直接连接到互联网时它工作但是它连接到他不工作的代理服务器.

import smtplib

smtpserver = 'smtp.live.com'
AUTHREQUIRED = 1 
smtpuser = 'example@hotmail.fr'  
smtppass = 'mypassword'  

RECIPIENTS = 'mailto@gmail.com'
SENDER = 'example@hotmail.fr'
mssg = "test message"
s = mssg   

server = smtplib.SMTP(smtpserver,587)
server.ehlo()
server.starttls() 
server.ehlo()
server.login(smtpuser,smtppass)
server.set_debuglevel(1)
server.sendmail(SENDER, [RECIPIENTS], s)
server.quit()
Run Code Online (Sandbox Code Playgroud)

python proxy

5
推荐指数
1
解决办法
9975
查看次数

标签 统计

proxy ×1

python ×1