Be careful, this does NOT work if your Gmail account has 2-factor enabled.
I use a separate gmail account for this sending of mails 1) to keep it out of my primary account, 2) my primary account has 2-factor enabled.
No, it’s not possible to auth to google using user and password. They removed this option and “Less secure access” was forcefully turned OFF by google last month on regular accounts.
Another reason not to have email handled by google…