Skip to content

Latest commit

 

History

History
37 lines (27 loc) · 1.13 KB

README.md

File metadata and controls

37 lines (27 loc) · 1.13 KB

Google-Script-API

This is one example that use Google Apps Script implemented as executable API to send emails through Gmail API.

Send emails with Google Script API is much easier than a classic method.

####How to: To use it, simply:

  • Create a project on Google Developers Console enabling the Gmail and Google Script Execution API. Then extract the client ID and paste it on:
var CLIENT_ID = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
function myFunction(email, subject, text) {  
    GmailApp.sendEmail(email, subject, text);
    return ['Email sent'];  
}
  • Then, implement it as a executable API, extract the script ID and paste it on:
var scriptId = "XXXXXXXXXXXXXXXXXXXXXXXXXXXX";

####Run To run, use your favorite server or simply type:

python -m SimpleHTTPServer

All rights reserved to Google.

Sorry if my English had mistakes, isn't my first language.