kootenpv / yagmail

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

using yagmail.smtp(), pyCharm asks for 'keyrings.alt' #38

Closed DanielTimLee closed 8 years ago

DanielTimLee commented 8 years ago

Before reporting some issues, I'd like to thanks so much for making this module! I was using Flask-mail, and there was some trouble with using it. (it's last updated date was about 2 years ago , so i moved on to Yagmail!)

I was having some troubles with yagmail connections, so i changed my code like this. (left -> right) (for some reason, it sometimes prints "[Error] Please run Connect() first" - maybe connection timed out?) image image

by changing this (one-liner) there were no more errors, but my pyCharm keeps prints "package requirement message." (though it works well!)

image

my question is 1.Why the Connect error occurs? 2.Why there is package requirement message?

kootenpv commented 8 years ago

Hi, thanks! Did you try registering only once though? For the registration you indeed need to have keyring installed. Do you use windows?

DanielTimLee commented 8 years ago

No, i use mac 10.10 yosemite.

Eventhough i don't have keyring installed, it works fine!! And i wonder why it is...?

kootenpv commented 8 years ago

Maybe pycharm is using a different version there? I suppose the keyring package has been installed anyway on Mac.

DanielTimLee commented 8 years ago

Oh. I have Keyring package!! (sorry for the mistake.)

For last question, Is there any connection timeout limit? If there is, how long is it?

kootenpv commented 8 years ago

You can give a timeout which will be passed to SMTP on creating yagmail.SMTP(timeout=10) if that's what you mean?

DanielTimLee commented 8 years ago

Not actually... but thanks for the kind answer!!

I was wandering if there is any default value for the timeout. ^^ But I guess I found it!

The optional timeout parameter specifies a timeout in seconds for blocking operations like the connection attempt (if not specified, the global default timeout setting will be used). If the timeout expires, socket.timeout is raised.

https://docs.python.org/2/library/smtplib.html