Just FYI. Once again (to eliminate any confusion). Google is not requiring OAuth2. You can still create app passwords and use them with your username for sending and accessing mail. OAuth2 is just another option (besides the app passwords) of doing it. App passwords work without any modification of existing code.
OAuth2 is always handy if it's implemented but it isn't the only option for Gmail. Even after the change on May 30, 2022.