此Bug出现在smtp.SMTP_SSL()类 Bug产生原因 当我们在SMTP_SSL类实例化的时候直接传入host及port时,可以正常连接服务器。但如果先实例化SMTP_SSL类后,再调用connect()方法时就会报 server_hostname cannot be an empty string or start with a leading dot. 的错误 import smtplib smtp_server = "smtp.