Send email using GMail API in Google Apps Script -
i have raw email (tested on playground , working) , want send google's gmail api google apps script.
i can't find right syntax request:
var requesturl = "https://www.googleapis.com/gmail/v1/users/emailaccount/messages/send"; var requestarguments = { mutehttpexceptions:true, headers: {authorization: 'bearer ' + token 'gdata-version': '3.0', 'content-type': "message/rfc822", }, payload: {"raw":raw}, method:"post" }; var result = urlfetchapp.fetch(requesturl,requestarguments);
what wrong syntax?
i found solution question:
var requestarguments = { headers: {authorization: 'bearer ' + token}, method: "post", contenttype: "application/json", payload: json.stringify(jsonmessage) };
jsonmessage whole message, not raw part!
Comments
Post a Comment