Send emails using Sendgrid with google appscript
<p>I am creating a googlesheet addon to send mails.And for sending mails I am using sendgrid.
I cannot find any documentation or example code for sending mails with Google Appscript. This is the code I am using, but it is no good.</p>

<pre><code>var data = {

        "api_user":"username",
        "api_key":"ioioi",
        "to":[],
        "tonnage":[],
        "cc":[],
        "ccname":[],
        "bcc":[],
        "subject":sub,
        "from":from,
        "html":htmlBody
      }

      var headers = { "Accept":"application/json", 
                     "Content-Type":"application/json"
                    };



        data = JSON.stringify(data);

        var options = {
          "method": "POST",
          "payload": data,
          "headers": headers,
          "muteHttpExceptions": true
        };

var res = UrlFetchApp.fetch("https://api.sendgrid.com/api/mail.send.json", options);
</code></pre>

<p>Does anyone have any idea or code to send emails with sendgrid using googl appscript?</p>