zhangyunhao116 / zmail

Zmail makes it easier to send and retrieve emails in python3
MIT License
433 stars 112 forks source link

发送邮件失败 #29

Closed GavinDingCoolapk closed 6 years ago

GavinDingCoolapk commented 6 years ago

源代码:

import zmail mail = { 'subject': 'Success!', 'content': 'This message from zmail!', }

server = zmail.server('blablabla', 'blablabla') server.send_mail('blablabla@163.com', mail)


Traceback: Traceback (most recent call last): File "C:\Users\Administrator\Desktop\mail\repeat.py", line 8, in server.send_mail('13138177056@163.com', mail) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\zmail\server.py", line 57, in send_mail server.send_ssl(recipients, message, timeout) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\zmail\server.py", line 207, in send_ssl server.login(self.user, self.password) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\smtplib.py", line 730, in login raise last_exception File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\smtplib.py", line 721, in login initial_response_ok=initial_response_ok) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\smtplib.py", line 642, in auth raise SMTPAuthenticationError(code, resp) smtplib.SMTPAuthenticationError: (535, b'Error: authentication failed')

GavinDingCoolapk commented 6 years ago

求教!

GavinDingCoolapk commented 6 years ago

发送与接收邮箱都是163,都开了SMTP/POP3

GavinDingCoolapk commented 6 years ago

最开始的测试显示: [WARNING] Login smtp error :[WinError 10061] 由于目标计算机积极拒绝,无法连接。 [WARNING] Login pop3 error :[WinError 10061] 由于目标计算机积极拒绝,无法连接。

zhangyunhao116 commented 6 years ago

这个错误一般是使用了错误密码,把SMTP POP 功能都开了以后使用授权码代替密码登录即可。

GavinDingCoolapk commented 6 years ago

可是密码没错,可能问题在那个什么积极拒绝无法连接,能否帮忙看看

zhangyunhao116 commented 6 years ago

不能使用密码登录 必须使用163邮箱的客户端授权码来登录 拒绝连接可能是连接次数过于频繁导致的 过一段时间会恢复

GavinDingCoolapk commented 6 years ago

我是运行这一段出错的: import zmail server = zmail.server('yourmail@example.com’, 'yourpassword')

if server.smtp_able(): pass

SMTP function.

if server.pop_able(): pass

POP function.

是不是和本地配置有关?

GavinDingCoolapk commented 6 years ago

解决了!谢谢!