kootenpv / yagmail

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

NameError: global name 'register' is not defined #77

Closed MrCreosote closed 7 years ago

MrCreosote commented 7 years ago

On Ubuntu 14.04 with python 2.7.6

$ sudo pip install yagmail[all]
# installed yagmail-0.7.165 keyring-10.3.3 secretstorage-2.3.1

$ python -c "import yagmail; yagmail.SMTP('[redacted]@gmailcom').send(subject='test done', contents='test whee')"
Password for <[redacted]@gmailcom>: 
Save username and password in keyring? [y/n]: y
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/yagmail/sender.py", line 68, in __init__
    self.login(password)
  File "/usr/local/lib/python2.7/dist-packages/yagmail/sender.py", line 183, in login
    password = self._handle_password(password)
  File "/usr/local/lib/python2.7/dist-packages/yagmail/sender.py", line 164, in _handle_password
    register(self.user, password)
NameError: global name 'register' is not defined
kootenpv commented 7 years ago

Thanks a lot for posting this! It has been fixed.

Please upgrade using:

pip install -U yagmail

It will work then :)