Tag: google apis explorer

无法通过nodejs发送带有googleapis服务帐户和JWTauthentication的邮件

我试图发送一个电子邮件使用服务帐户和JWT身份validation,并不断获取和一个非常无益的消息错误: { code: 500, message: null } 此代码片段来自以下StackOverflow链接: 无法通过nodejs中的google api发送邮件 这似乎是解决scheme是将参数中的密钥更改为resource而不是message但它不适合我。 这很奇怪,因为在文档( https://developers.google.com/gmail/api/v1/reference/users/messages/send )中的JS示例中,它声称密钥仍然是message 我正在用身份validation var jwtClient = new google.auth.JWT(config.SERVICE_EMAIL, config.SERVICE_KEY_PATH, null, config.ALLOWED_SCOPES); 然后发送一封电子邮件 jwtClient.authorize(function(err, res) { if (err) return console.log('err', err); var email_lines = []; email_lines.push("From: \"Some Name Here\" <rootyadaim@gmail.com>"); email_lines.push("To: hanochg@gmail.com"); email_lines.push('Content-type: text/html;charset=iso-8859-1'); email_lines.push('MIME-Version: 1.0'); email_lines.push("Subject: New future subject here"); email_lines.push(""); email_lines.push("And the […]