gmail-api

In what order does the Gmail API return messages when calling “Users.messages: list”

旧巷老猫 提交于 2019-12-05 09:53:32
According to the Gmail API reference , Users.messages: list "[lists] the messages in the user's mailbox". In my observation, the messages are returned in descending order by data. Is this a correct assumption? Basically I want to be able to process a user's inbox after a couple of days without reprocessing messages I have already processed. I would do that by stopping once I stumble upon an email I have seen before. Using the history doesn't work reliable, since it is documented that history might expire within a few hours, requiring a full new sync. Yes, you are correct. Messages are returned

Delphi - Indy - saving GMail draft

泪湿孤枕 提交于 2019-12-05 06:56:02
I've been using Indy under Delphi to send message via a gmail account, using the TIdSMTP and TIdMessage components. This works absolutely fine. However, my client has requested to save the message to the DRAFTS folder to allow him to make changes to the (programatically created) message before actually sending it. GMail API is supposed to support this, but the provided examples are not in Delphi/Indy formats... I'm looking for minimal programming changes so I'd like to know if it is possible in the Indy components too? TIdMessage allows for a "mfDraft" flag, but this doesn't prevent the

How to extract full body content of a Bounced back email?

人走茶凉 提交于 2019-12-05 05:35:43
问题 The above screenshot is the sample of the Bounced Back Mail received. I'm using the following code to extract the Body of the mail. function test() { var BouncedEmails = GmailApp.search("label:test The following message was undeliverable "); for( var i=0;i<BouncedEmails.length;i++) { var Gmessage = GmailApp.getMessagesForThread(BouncedEmails[i]); for(var j=0;j<Gmessage.length;j++) { var body = Gmessage[j].getPlainBody(); Logger.log(body); } } } But when I am doing this, I got the following

Can I get a URL link to a Gmail draft using the Gmail API?

余生颓废 提交于 2019-12-05 05:33:37
The new Gmail API allows us to create and view drafts, but is there a way to get a URL link to view the draft? I can manually create the link using the draft's ThreadId with something like this: https://mail.google.com/mail/u/0/#drafts?compose= {ThreadId} But that is somewhat fragile if Google decides to change how those URLs are structured. I also don't know if the URL will be different for people in other countries. The 0 will also change depending on how many accounts you are logged into in the browser. Is there a better way to get this link than creating it manually like I am? Also, is

Insufficient Permission [403] error while modifying the Message Label using gmail API in c#

随声附和 提交于 2019-12-05 04:13:45
I am trying to read the gmail mail message, using gmail api, and after reading the mail, I am removing the message label, so that I don't need to process it again. I am able to read the mail successfully, but when I am trying to modify the message Label ( service.Users.Messages.Modify(mods, userId, messageId).Execute(); ) then I am getting the error message: An error occurred: Google.Apis.Requests.RequestError Insufficient Permission [403] Errors [ Message[Insufficient Permission] Location[ - ] Reason[insufficientPermis sions] Domain[global]> ]. I am not able to figure out, what may have gone

Find timestamp for hangout and chat messages retrieved with gmail api

China☆狼群 提交于 2019-12-05 04:13:23
While fiddling with the Gmail API, I noticed that if I don't use any filters, the Users.messages: list method also returns messages sent and received through Google Hangout or Gmail Chat. Which is very nice. The json object for a Hangout message is structured like an email (with payload, headers etc), but the only header provided is the sender. There's no information about the time the message is sent. I've looked through all other Gmail API methods (threads, history...) but none of them provides datetime information for chat messages. Any idea if/how I could lookup a timestamp for chat

Gmail API quota units cost

我怕爱的太早我们不能终老 提交于 2019-12-05 03:44:29
We are building a service that utilizes the Gmail API. In order to understand our costs as we scale, I would like to know how much it costs to use the Gmail API. I've followed the instructions at https://developers.google.com/gmail/api/v1/reference/quota through to the point at which it says: If you have enabled billing for your project [we have], clicking Quota takes you to a page where you can view and change quota-related settings. The only option on that page for changing our daily quota is to "Apply for higher quota"; however, clicking that opens a window that says: Please be sure to

How to edit Gmail messages as they arrive?

为君一笑 提交于 2019-12-05 03:30:26
问题 Ultimately my objective is to prevent email tracking via auto-loaded images with unique links. I'm aware that Google uses a proxy to load the images so at least they won't reveal my IP address, but there are certain individuals and organizations that annoyingly embed trackers into their emails -- and they actively check whether or not I read their emails. In the Gmail app specifically, I can turn off auto-loading of images, but I'd like to have similar protection for other apps that don't

How to send message to multiple recipients?

泪湿孤枕 提交于 2019-12-05 02:09:43
I'm having some trouble sending a message to multiple addresses using the Gmail API. I've successfully sent a message to only one address, but get the following error when I include multiple comma-separated addresses in the 'To' field: An error occurred: https://www.googleapis.com/gmail/v1/users/me/messages/send?alt=json returned "Invalid to header"> I'm using the CreateMessage and SendMessage methods from this Gmail API guide: https://developers.google.com/gmail/api/guides/sending That guide states that the Gmail API requires messages that are RFC-2822 compliant. I again didn't have much luck

Lots of threads missing in Users.threads.list()

梦想的初衷 提交于 2019-12-05 00:00:13
问题 I am retrieving threads from my GMail account using the Users.threads.list method, with the query "in:sent newer_than:1y". The first page of results (100 threads) looks OK, with threads from Dec 2014 and Jan 2015. However, the second page starts at June 2014, and goes back to May 2014 etc. It looks like whole pages of threads are missing for the months of July-November 2014. I have reproduced this using the in-page API tester at https://developers.google.com/gmail/api/v1/reference/users