HI This is a great article and a lifesaver in terms of getting Gmail set up.

Just a note if anyone has 2 step verification and your SMTP protocol returned "ERROR: 535-5.7.8 Username and Password not accepted. Learn more at" and have an older version of SAS, a simple solution is to set up an "App-Password".

Go to my account - security settings- click on app passwords and add a new app (you can name it what either you want). You then replace your Gmail password in emailpw with the code generated by the app password and you will now be able to send emails again.