我有一个发送电子邮件的探针。代码:
import smtplib
import socks
socks.setdefaultproxy(socks.SOCKS5, '10.21.197.46', 8080)
socks.wrapmodule(smtplib)
smtpserver = 'smtp.savana.cz'
AUTHREQUIRED = 1
smtpuser = 'email@email.cz'
smtppass = 'pass'
RECIPIENTS = 'to@email.cz'
SENDER = 'from@email.cz'
mssg = "test message"
s = mssg
server = smtplib.SMTP(smtpserver,465)
server.ehlo()
server.starttls()
server.ehlo()
server.login(smtpuser,smtppass)
server.set_debuglevel(1)
server.sendmail(SENDER, [RECIPIENTS], s)
server.quit()
但是结果是程序卡住了(启动后20分钟)
谢谢您的建议。