I\'m trying to send an email through Google API with JavaScript.
My issue is that when I try to send a simple mail with no attachments, I get the following error:
After days i had found the answer by my own. The problem was that the 'message' in the body only can be used when you send an attachment in the email.
If you have no attachment the query looks like I wrote down here
var mail= base64EncodedEmail;
console.log(mail);
var request = gapi.client.gmail.users.messages.send({
'userId': "me",
'resource': {
'raw': mail
}
});
request.execute(function(response){
console.log(response);
});