kootenpv / yagmail

Send email in Python conveniently for gmail using yagmail
MIT License
2.66k stars 265 forks source link

connection reset by peer #190

Open yangyxt opened 3 years ago

yangyxt commented 3 years ago

I tried to follow the tutorial of yagmail and constantly getting the same Error [Errno 104] Connection reset by peer.

I first tried using an email address and a password to directly set an SMTP connection. SMTP instance is established without error prompt while it hit the reset connection issue at SMTP.send() step.

Then I tried to use OAuth in google following this guide you provided: https://blog.macuyiko.com/post/2016/how-to-send-html-mails-with-oauth2-and-gmail-in-python.html

Everything runs smoothly except for the last step when trying to send a test email to my another account. The Error is still the same one:

image
kootenpv commented 3 years ago

For this email you probably need a different "host" rather than the default Gmail one

yangyxt commented 3 years ago

Sorry I didn't quite get it. Would you care to explain a bit more?

kootenpv commented 3 years ago

It's the argument to SMTP class... try to find out this value for connect hku hk.

yangyxt commented 3 years ago

It's the argument to SMTP class... try to find out this value for connect hku hk. Sorry for late response. I not only tried the campus email address. I also tried other normal gmail addresses and hit the same error. So I don't think this is relevant to the issue.