Failed sending mail through google api in nodejs

前端 未结 1 1832
故里飘歌
故里飘歌 2021-01-02 00:34

I\'m trying to send an email through Google API.

I\'m using googleapis for Google API access in node.js .

My issue is that when I try to send a simple mail w

1条回答
  •  囚心锁ツ
    2021-01-02 00:49

    Changes were made to version 1.0.3 of the google api. Try using the following syntax:

    gmailClass.users.messages.send({
        auth: OAuth2Client,
        userId: "me",
        resource: 
        {
             raw: base64EncodedEmail
        }           
      }
    

    Make sure that base64EncodedEmail is url safe. You can use the base64EncodedEmail.replace(/\+/g, '-').replace(/\//g, '_') code posted by mscdex. This syntax worked for v. 1.0.11

    0 讨论(0)
提交回复
热议问题