I read the error log when I was trying to use Gmail to send an ebook to my kindle. In that log, there were instructions from Google.
https://support.google.com/accounts/answer/185833
I had already read that using TLS with port 587 was necessary. Elsewhere I read I could use SSL and port 465 but I later read something about only using TLS so that is what I used.
After following these instructions for "application specific passwords" it worked.