SMTP error 554 !!
哇,我真的amazing, incredible!!
我只是想写一个简单的邮件,结果他一直报554错误!!!
期间,通过百度,我发现了可能导致 此,讨厌至极的错误,有N多原因;
但我的原因 谜之离谱!
Can you imagine!! 我仅仅只是换了目前16-18行的代码,之前是放于9行以后的位置;
我真不明白smtp我又没发送,放在msg前还是后有什么影响。。
嗯,吐槽到这里,我的心情好多了,哈哈😄
Maybe 我写博客的意义就在于此吧,吐槽满点,瞬间情绪舒畅哈哈哈~~
1 from smtplib import SMTP 2 from email.mime.text import MIMEText 3 from email.mime.multipart import MIMEMultipart 4 5 sender = 'liubilan_villain@163.com' 6 receiver = '***@qq.com' 7 # receiver = ['***@qq.com', 'liubilan_villain@163.com'] 8 password = '*****' 9 msg = MIMEMultipart() 10 msg['Subject'] = "liubilan" 11 msg['From'] = sender 12 msg['To'] = receiver 13 txt = MIMEText("I hate SMTP!!! Much too trouble!! I hate error 554!!!") 14 msg.attach(txt) 15 16 smtp = SMTP() 17 smtp.connect('smtp.163.com', '25') 18 smtp.login(sender, password) 19 smtp.sendmail(sender, receiver, msg.as_string()) 20 smtp.quit()