2
我正在创建一个googlesheet插件来发送邮件。并且用于发送邮件我正在使用sendgrid。 我找不到任何有关使用Google Appscript发送邮件的文档或示例代码。这是我正在使用的代码,但它并不好。用google appscript发送使用Sendgrid的电子邮件
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);
有没有人有任何想法或代码发送电子邮件sendgrid使用googl appscript?