我一直在尝试验证用户在我的程序中输入的电子邮件地址。我目前拥有的代码是:
server = smtplib.SMTP()
server.connect()
server.set_debuglevel(True)
try:
server.verify(email)
except Exception:
return False
finally:
server.quit()
然而当我运行它时,我得到:
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
我想知道如何使用smtp模块验证电子邮件地址,以确定该邮件地址是否真实存在。