Code Monkey home page Code Monkey logo

mmailapp_gs's Introduction

📮MmailApp_gs

Library for sending emails with Google Apps Script. Use MailApp, GmailApp or GmailAPI. The library simpifies the usage of methods.

Install

Library code is:

1XHgOqNIXoRxmM7StfIoxxqTVNoEVNpO46UsSSZdXZI4fezxCRIpSYHtB 🔗Source

If you would like to use Gmail API, please enable it as advanced Google Service.

Try

Please see how it works in a visual way:

  1. Copy ⚡ Automation Samples project file. Go to menu File > Make a Copy.
  2. Change settings on the sheet: _sendmail_.
  3. Use the menu 💌 Mail > 📮 Send Emails to test the script.
  4. Success: you'll send emails and see the logs in the last rows of sheet: 📜 logs.

Use

Please use this sample code with all possible settings:

function test_getMailApp() {
  var options = {
    to: '[email protected]', // required
    cc: '[email protected]',
    bcc: '[email protected],[email protected]',
    name: '🎩Mad Hatter',
    // from: '[email protected]', // for paid accounts + alias
    subject: '🥸Test Test Test',
    body: '💪 body!',
    htmlBody: '<b>💪Bold Hello</b><br>How are you?',
    noreply: 1,
    replyto: '[email protected]',
    // replytoname: 'Maaan', // works for Gmail API
    // attachments: array,
    // inlineimages: object
  }
  try {
    // try using MailApp, or GmailApp
    var response = MMailApp.send(options);
    console.log(response);
  } catch(err) {
    console.log(err);
  }
}

If you want to force the use of Gmail API:

 // this will forse the use of Gmail API
 MMailApp.sendGmailApi(options);

More

More info and all the links that helped me are posted in this article:

Author

@max__makhrov

CoolTables cooltables.online

mmailapp_gs's People

Contributors

max-makhrov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.