gmail-api

TypeError: Cannot read property 'redirect_uris' of undefined

雨燕双飞 提交于 2021-01-23 11:13:06
问题 I want to write an app that can process some of my gmail emails that are labeled a certain way. The example code here gave me a starting point for my code (which I've rewritten using promises instead of async await): 'use strict'; const path = require('path'); const { google } = require('googleapis'); const { authenticate } = require('@google-cloud/local-auth'); authenticate({ keyfilePath: path.join(__dirname, 'key.json'), scopes: [ 'https://www.googleapis.com/auth/gmail.readonly', ], }).then

Emoji is not rendered in the subject of gmail

时光总嘲笑我的痴心妄想 提交于 2021-01-05 08:52:20
问题 I am using GMAIL api to send email from the nodejs api. I am rendering the raw body using the following utility function message += '[DEFAULT EMOJI 😆]' const str = [ 'Content-Type: text/html; charset="UTF-8"\n', 'MIME-Version: 1.0\n', 'Content-Transfer-Encoding: 7bit\n', 'to: ', to, '\n', 'from: ', from.name, ' <', from.address, '>', '\n', 'subject: ', subject + '[DEFAULT EMOJI 😆]', '\n\n', message ].join(''); return Buffer.alloc(str.length, str).toString('base64').replace(/\+/g, '-').replace

How can I extract Information in a Google Sheet from a xlsx gmail attachment via google apps script

我的梦境 提交于 2021-01-01 09:16:40
问题 I want to extract the content from an xlsx gmail attachment via google apps script. And then put the information into a Google Sheet. It's working fine for CSV files, but I don't get the content of a xlsx file. 回答1: Unlike csv files, xlsx file data cannot be directly inserted into a spreadsheet What you can do instead: Save the attachment on your disc in its original mimeType Convert it to a Google Sheets document with e.g. Drive.Files.copy Delete the excel file from your disc Sample:

How to get the text/plain part of a Gmail API message

十年热恋 提交于 2020-12-13 04:43:45
问题 So sometimes the text/plain is in the top level "parts" array of a GmailAPI recovered email and other times it is nested down in the JSON if there are attachments or inline emails then it is nested down deeper. How should I approach always being able to retuurn the text/plain version of body. Thanks 回答1: I actually had this issue as well, hoping to find an awnser here. I'm by no means a python expert and above that im a stackoverflow beginner :-). but let me share with you my solution and my

Unable to send mail using gmail api node js

风格不统一 提交于 2020-12-13 02:59:29
问题 I have followed gmail api for sending email. I am getting error as: "message": "400 - \"{\n \\"error\\": {\n \\"errors\\": [\n {\n \\"domain\\": \\"global\\",\n \\"reason\\": \\"invalidArgument\\",\n \\"message\\": \\"'raw' RFC822 payload message string or uploading message via /upload/* URL required\\"\n }\n ],\n \\"code\\": 400,\n \\"message\\": \\"'raw' RFC822 payload message string or uploading message via /upload/* URL required\\"\n }\n}\n\"" Here is the piece of code I have written for

Unable to send mail using gmail api node js

独自空忆成欢 提交于 2020-12-13 02:59:14
问题 I have followed gmail api for sending email. I am getting error as: "message": "400 - \"{\n \\"error\\": {\n \\"errors\\": [\n {\n \\"domain\\": \\"global\\",\n \\"reason\\": \\"invalidArgument\\",\n \\"message\\": \\"'raw' RFC822 payload message string or uploading message via /upload/* URL required\\"\n }\n ],\n \\"code\\": 400,\n \\"message\\": \\"'raw' RFC822 payload message string or uploading message via /upload/* URL required\\"\n }\n}\n\"" Here is the piece of code I have written for

reading gmail is failing with IMAP

我的梦境 提交于 2020-12-03 14:50:51
问题 I am running a cron job which executes the python script for reading gmail (2 min interval). I have used imaplib for reading the new mails. This was working fine until yesterday. Suddenly its throwing below error imaplib.error: [AUTHENTICATIONFAILED] Invalid credentials (Failure) and sometimes i am getting the below error raise self.abort(bye[-1]) imaplib.abort: [UNAVAILABLE] Temporary System Error When i run the same script on a different machine. Its working fine. I am assuming that the

reading gmail is failing with IMAP

白昼怎懂夜的黑 提交于 2020-12-03 14:48:25
问题 I am running a cron job which executes the python script for reading gmail (2 min interval). I have used imaplib for reading the new mails. This was working fine until yesterday. Suddenly its throwing below error imaplib.error: [AUTHENTICATIONFAILED] Invalid credentials (Failure) and sometimes i am getting the below error raise self.abort(bye[-1]) imaplib.abort: [UNAVAILABLE] Temporary System Error When i run the same script on a different machine. Its working fine. I am assuming that the

reading gmail is failing with IMAP

荒凉一梦 提交于 2020-12-03 14:45:58
问题 I am running a cron job which executes the python script for reading gmail (2 min interval). I have used imaplib for reading the new mails. This was working fine until yesterday. Suddenly its throwing below error imaplib.error: [AUTHENTICATIONFAILED] Invalid credentials (Failure) and sometimes i am getting the below error raise self.abort(bye[-1]) imaplib.abort: [UNAVAILABLE] Temporary System Error When i run the same script on a different machine. Its working fine. I am assuming that the

reading gmail is failing with IMAP

蹲街弑〆低调 提交于 2020-12-03 14:45:30
问题 I am running a cron job which executes the python script for reading gmail (2 min interval). I have used imaplib for reading the new mails. This was working fine until yesterday. Suddenly its throwing below error imaplib.error: [AUTHENTICATIONFAILED] Invalid credentials (Failure) and sometimes i am getting the below error raise self.abort(bye[-1]) imaplib.abort: [UNAVAILABLE] Temporary System Error When i run the same script on a different machine. Its working fine. I am assuming that the