That stack overflow link solves the issue, although they are using C# I replicated the steps on my own database and emails are being sent out again. Basically you need to create an app password in Gmail, but below are the steps I followed to resume the mailing system. If you can't find the security tab. Search for "Gmail Security tab" on google itself.
Now you can manage Apps password:
- Go to Gmail account settings , and click on security tab
- Add 2 step verification (if you don't have)
- Click on "App Password"
- Select application device or add new one (Select 'Other' when it askes you to select an app you want to connect to, then enter in whatever name you want to give the app and generate a
new password.) - You will get new password to use in your app
Additional Steps for SQL Server------------------------
6. Head to the database mailing system.
- In your database mailing system you want to manage the existing account that previously was sending out mail and make sure you have "This server requires a secure connection (SSL)"
checked. - For the SMTP Authentication select "Basic Authentication" then enter in your email address in the username box.
- For the password paste in the one you generated earlier.
- Send out a test email/retry any previously failed email attempts.