Failed sending mail through google api with javascript

前端 未结 1 1220
夕颜
夕颜 2020-12-01 19:05

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:

相关标签:
1条回答
  • 2020-12-01 19:55

    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);
    });
    
    0 讨论(0)
提交回复
热议问题