gmail-api

Gmail API for sending mails in Node.js

回眸只為那壹抹淺笑 提交于 2019-11-27 01:03:00
问题 Disclaimer: I have followed Google's own Node.js quickstart guide and successfully connect and use the gmail.users.labels.list() functionality. I have checked for questions/answers here, like this one (that is not using the Node.js API I am asking about), or this one (similar to this one) which apparently is the same problem I have but the solution does not work. My problem: When using Google's Node.js API I get a error trying to send a email. The error is: { "code": 403, "errors": [{ "domain

'observe' on 'MutationObserver': parameter 1 is not of type 'Node'

别来无恙 提交于 2019-11-26 23:27:49
问题 I am creating a Chrome extension and trying to include a small text beside the SEND button of the gMail compose box. I am using a MutationObserver to know when the compose box window appears. I am doing this by observing an element with class no since the compose box element is created as child of this element (class no ). When the user clicks on the compose button and the compose box window appears, then I place an element beside the SEND button using the .after() method. SEND button class

Gmail API users.watch - no details for historyId

て烟熏妆下的殇ゞ 提交于 2019-11-26 23:09:31
问题 I have successfully set up Google Pub/Sub to use Gmail API Watch feature as described here: https://developers.google.com/gmail/api/guides/push to watch INBOX label in my gmail account. Once new message arrive I instantly get a push notification in valid format like: { message: { data: '.......', attributes: {}, message_id: '1248700053943' }, subscription: '.....' } After I base64decode data I get email and historyId. Then, as suggested, I request gmail.users.history.list API (via API console

Where to find body of email depending of mimeType

房东的猫 提交于 2019-11-26 22:54:51
问题 I am making a request to the User.messages endpoint. All objects returned (the emails) have a mimeType property which I'm struggling to understand. More specifically, I want to be able to extract the body of the email depending of the mimeType since I've been able to notice that depending on the mimeType, the body will be inside the body property in payload , or in the parts array. What are the different mimeTypes that can be returned, and where can I find the body of the email for each one

I keep getting an error that my app needs to be verified when either I or another user try to authorize with OAuth2. What does that mean?

独自空忆成欢 提交于 2019-11-26 22:44:19
问题 I received this error when trying to authorize my app with my own account: Your project is trying to access scopes that need to go through the verification process. {invalid=https://www.googleapis.com/auth/contacts} If you need to use one of these scopes, submit a verification request. Learn More When I use a different account, the error message is different: This app hasn’t been verified to access: {invalid=https://www.googleapis.com/auth/contacts} Are you the developer? If this project

Mail attachment wrong media type Gmail API

∥☆過路亽.° 提交于 2019-11-26 22:30:43
I'm trying to send a message with a jpeg file attached through the Gmail API in Javascript client side. The code I've written so far is as follows: $.ajax({ type: "POST", url: "https://www.googleapis.com/upload/gmail/v1/users/me/messages/send?uploadType=multipart", headers: { 'Authorization': 'Bearer ' + accessToken, 'Content-Type': 'multipart/related; boundary="foo_bar_baz"' }, data: data }); Where data is a string built up like the example found here : --foo_bar_baz Content-Type: application/json; charset=UTF-8 { "raw":

How to get the reply message without the original message from the Gmail API

僤鯓⒐⒋嵵緔 提交于 2019-11-26 21:37:56
问题 I would like to get the reply message in a thread without the original message. However, when I use either Users.messages: GET or Users.threads: GET, I receive the reply (as desired) with the original message (undesired) as well. See screenshot below code. (This question, as far as I can tell, was also posed here, however I did not find that the proposed solution answers the question and the poster of the proposed solution suggested I start a new question. I tried with Users.threads as Tholle

Get sender email from gmail-api

[亡魂溺海] 提交于 2019-11-26 17:25:46
问题 I am using the gmail-api and having trouble getting the email of the sender. I am talking about the "full" format of the email. I consider the email of the sender to be the one that is actually written in the "From" field using the web interface of gmail. The headers of this full format usually include stuff like "X-Original-Authentication-Results" from which normally I can retrieve the smtp.mail value which is the sender's email but there are other emails where this header cannot be found.

How to use the Gmail API, OAuth2 for Apps Script, and Domain-Wide Delegation to set email signatures for users in a G Suite domain

两盒软妹~` 提交于 2019-11-26 16:38:28
问题 This is a follow-up to a previous question/answer I posted (How to use the Google Email Settings API and the OAuth2 for Apps Script Library to set email signatures for users in a Google Apps domain), but I'm creating a new question since the Email Settings API has been deprecated and the process is significantly different now. As the administrator of a G Suite domain, how do you use the Gmail API to programmatically set the email signatures of users in your domain through Google Apps Script?

Cannot get the body of email with Gmail PHP API

随声附和 提交于 2019-11-26 16:26:35
I'm having trouble with the Gmail PHP API. I want to retrieve the body content of emails, but I can retrieve it only for emails which have attachments! My question is why? Here's my code so far: // Authentication things above... $client = getClient(); $gmail = new Google_Service_Gmail($client); $list = $gmail->users_messages->listUsersMessages('me', ['maxResults' => 1000]); while ($list->getMessages() != null) { foreach ($list->getMessages() as $mlist) { $message_id = $mlist->id; $optParamsGet2['format'] = 'full'; $single_message = $gmail->users_messages->get('me', $message_id, $optParamsGet2)