Another thing to check, is if you have an email address that’s set up as an alias (e.g. sales@ being an alias of dave@), then the username needs to be the address attached to the account (in this case, “dave”).
In order to be able to do SMTP logging in with your plain username and password like this you have to have your google account configured to allow “less secure apps”, and even if you’ve enabled this in the past google say they turn it off for you if they see it hasn’t been used for a while.
Alternatively, if you do enable two factor auth then you can generate an “app password” to use instead of your main one, which I don’t believe requires less secure apps to be enabled.