【问题标题】:How to get the message id after sending a new message with gmail api?使用gmail api发送新消息后如何获取消息ID?
【发布时间】:2016-05-29 09:35:44
【问题描述】:

使用gmail api发送新消息后如何获取消息ID?

function sendMessage(userId, email, callback) {
  var base64EncodedEmail = btoa(email);
  var request = gapi.client.gmail.users.messages.send({
    'userId': userId,
    'message': {
      'raw': base64EncodedEmail
    }
  });
  request.execute(callback);
}

【问题讨论】:

    标签: javascript gmail-api google-api-js-client


    【解决方案1】:

    我找到了解决方案: 在回调函数中,我们将获得一个 arguments 对象,其中包含有关已发送消息的所有信息,例如 id ,labelId ...ect :

     function callback(){
        var idMail=arguments[0].id;
        /*Stored into the dataBase or others operations */
     }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-09-11
      • 2020-07-03
      • 1970-01-01
      • 1970-01-01
      • 2016-03-18
      • 1970-01-01
      • 2018-07-14
      相关资源
      最近更新 更多