import smtplib
server=smtplib.SMTP('smtp.yandex.com',465)
server.starttls()
server.login('[email protected]','XXXXX')
message='hurray'
server.sendmail('[email protected]','[email protected]',message)
server.quit()
print('E-mail successfully sent!')
注意:这里 .cf 是一个免费域。我有一个免费的基于域的电子邮件地址([email protected])和 yandex。
为什么这段代码不起作用?yandex 帐户中的任何配置设置需要更改吗?
对于 Yandex 邮件服务,STARTTLS 也不适合我。更换这个
server=smtplib.SMTP('smtp.yandex.com',465)
server.starttls()
和
server=smtplib.SMTP_SSL('smtp.yandex.com',465)
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句