I am using my own command line email program (written in C) to send emails. As of 30th May 2022 Google have discontinued using insecure app passwords to authenticate, which was required to bypass their requirement for 2-step authentication.
How do I include the two-step authentication code in my C program to so that I can continue sending email through a Gmail account?
Please note that I need to have the C email program independent, ie. to use as little dependencies as possible. I also need to have it working in Windows and Linux environments.