i have 2 comments:
1) when you say your gmail account is set up correctly, do you mean that you have "less secure app access" turned on? without it, google won't act as your smtp sender. by the way, i have used the service, but google turns it off if you don't use it regularly. such was the case when i went to my account to see about answering your question.
2) i forget why, but when i wrote my email app a number of years ago, in addition to the net library, i also see that i used the smtpextras library. you may want to check that out as well. perhaps it simply offered some feature i needed at the time.
by the way, i hope it's not your plan to distribute an app that uses your gmail credentials.