How to Get User Email from Google App Script

TV - May 1, 2021


This short article will detail how to retrieve a user's Gmail address using Google App Script.

If you are using the code editor in App script, copy and paste the following code into the Code.gs file:

function myFunction() {console.log(Session.getActiveUser().getEmail());}

Then, click the "Run" button and you should see your email printed out in the console.

When deploying a Google App Script add-on for other people to use, you will also need to have the "https://www.googleapis.com/auth/userinfo.email" scope set for your add-on in the appsscript.json file like so: