Google Apps Script Tutorial #1: Sending Email

Here’s a quick tutorial about how to send email via Google Apps Script.

Step #1: Go to script.google.com and sign in to Google if needed.

Step #2: Click Blank Project

Step #3: Enter the code below. The code below must be the only code that appears in the editor.  The color highlighting will be different.

function myFunction() {
  MailApp.sendEmail("JohnDoe@csi.com", "Subject Here", "This is the body of your email");
}

Your project should look very similar to this…

Step #4: Click “Untitled project” to give it a title.

Step #5: Save your work!

Step #6: Press play to run your code. (Hint – replace the email address in the sample code above with your own email address to test it.)

Step #7: Congratulate yourself, you’ve just sent an email through Google Apps Script!