Reputation: 1194
I sent an email with the following python code:
import yagmail, sha, sys, os
os.system('stty -echo')
password = raw_input('Gmail password: ')
os.system('stty echo')
print ''
if not sha.sha(password).hexdigest() == 'digest_of_the_password':
print 'Password Declined'
sys.exit()
yag = yagmail.Connect('[email protected]', password)
yag.send('[email protected]', 'Hi', "G'day")
The subject came out as 'Hi', but the body came out 'RydkYXk='. I installed yagmail with the command: sudo pip install yagmail
in my mac terminal.
How do I fix this error?
Upvotes: 2
Views: 258
Reputation: 21451
I'm terribly sorry as the maintainer!
I accidentally added a tab in the wrong line, which added the base64
encoding also to text!
If you would now use sudo pip install -U yagmail
it will upgrade to the new version where this has been resolved.
For future bugs, please file them at github, I will try to resolve all issues within 24 hours from posting.
Note that now you can simply omit the password: it will save it safely in the keyring after prompting you for the password once. That would save you many lines in this case:
import yagmail
yag = yagmail.SMTP('[email protected]')
yag.send('[email protected]', 'Hi', "G'day")
Upvotes: 2