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:
varCLIENT_ID='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';- Create a Google Script file on Google Apps Script. The Google Script code used is:
functionmyFunction(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:
varscriptId="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.