gmail-api

Decode URL Safe Base64 in JavaScript (browser side)

自作多情 提交于 2019-11-29 06:38:29
I am using Gmail's API to get emails from my account. The body of the message is delivered in a "URL safe base64" format. What is the best way to decode this for use? I have found some nodejs solutions, but no client side ones. window.atob does not work since it is URL safe. Thanks for any help. For posterity, atob(data.replace(/_/g, '/').replace(/-/g, '+')) As stated by the spec https://tools.ietf.org/html/rfc4648#section-5 however because this uses atob() it does not support unicode characters and thus requires a polyfill . Finally found it. This does URL Safe decoding https://github.com

How can I reliably link to a Gmail conversation given a thread ID if the user is logged into multiple accounts?

若如初见. 提交于 2019-11-29 04:59:00
If you're logged into multiple Gmail accounts, Google changes the URLs to reference which account you're currently using. For example: https://mail.google.com/mail/u/0/#inbox/138d85da096d2126 for a convo in my primary account vs https://mail.google.com/mail/u/1/#inbox/128cfe99d055805d for a convo in another one of my accounts. Note that one account has /u/0 in the URL and the other has u/1 . My question is: given that I've used the Gmail REST API to find the ID of a particular thread, how can I reliably link to that thread? Is there any programmatic way to ask Google which accounts the user is

how to use GMAIL API query filter for datetime

空扰寡人 提交于 2019-11-29 04:48:40
I am using GMAIL API over REST interface to read mails from gmail server, my problem is when I am using date filter by giving a date as 'after:2014/8/20 before:2014/8/22' then the mails starting from 2014/8/20 12.30 PM onwards are downloaded (ideally it should consider mails from 12.00 AM). Mails from night 12.00 AM till noon 12.30 PM are skipped. I think server is using PST time zone. Can I specify time in the filter? or is there a way to specify time zone so that I get all the mails. code used: UsersResource.MessagesResource.ListRequest request = null; ListMessagesResponse response = null;

Gmail API - Parse message content (Base64 decoding?) with Javascript

隐身守侯 提交于 2019-11-29 04:46:34
问题 I'm trying to use the Gmail API to get a user's email, grab the message subject and body, and then display it on a webpage. I'll be doing other stuff with it, but this is the part that I am having difficulty with. I am using Angular.js. Here is my API call: function makeApiCall() { gapi.client.load('gmail', 'v1', function() { var request = gapi.client.gmail.users.messages.list({ labelIds: ['INBOX'] }); request.execute(function(resp) { var content = document.getElementById("message-list");

Send Mail with attachment using Gmail new API, but it is not displayed for receiver's inbox

ぃ、小莉子 提交于 2019-11-29 04:35:26
We are integrating GMail using the latest API provided by them as a part of developing email client within our application. We are using PHP client library provided by Google. See the link https://developers.google.com/api-client-library/php/ In this I'm trying to send a mail with attachment. Here we have generated message/rfc822 compatible text and passed it with 'raw' parameter. Here the problem I found is, after executing the code, when I checked the sent mail for the mail which I sent via GMail API, the attachments are shown correctly. But it is not received/ displayed for the sender's

Creating a Message for Gmail API in C#

岁酱吖の 提交于 2019-11-29 04:19:57
I'm looking at using the Gmail API in an application I'm working on. However, I'm not sure how to change their Java or Python examples over to C#. How exactly does the existing sample change over? Sample found here. Xtros Here is what I was able to get working, using MimeKit . public void SendEmail(MyInternalSystemEmailMessage email) { var mailMessage = new System.Net.Mail.MailMessage(); mailMessage.From = new System.Net.Mail.MailAddress(email.FromAddress); mailMessage.To.Add(email.ToRecipients); mailMessage.ReplyToList.Add(email.FromAddress); mailMessage.Subject = email.Subject; mailMessage

How to send email through Gmail Go SDK?

血红的双手。 提交于 2019-11-29 03:52:02
问题 I'm trying to send a new email through the gmail package . However the Message type which is required by the send method is poorly documented. Most of the fields seem used to actually parse/read emails. The only field which makes sense (at some degree) for the send method is Payload of type MessagePart though I can't figure it out how to generate the MessagePartBody as it seems to be a kind of mime type. Below is the code I have so far. func (em *Email) SendMessage(cl *Client) error { config

Is there an URL to open the Gmail compose window with a specific message ID in full-screen (pop-out)

自作多情 提交于 2019-11-29 02:19:34
问题 I use the new Gmail API to create a draft for my user. The API response provides the newly created message ID. I can then open the compose window with the URL https://mail.google.com/mail/#drafts?compose=[message-id] . However I would like to open a full-screen (popped-out) compose window. Is there an URL for that ? This URL must of course be parameterised with the message id. To be more precise, this is what I get, and this is what I want. 回答1: Try this: https://mail.google.com/mail?authuser

Attribute Error trying to run Gmail API quickstart in Python

让人想犯罪 __ 提交于 2019-11-29 01:22:11
It looks like there might be a version mismatch problem here. How should I go about fixing it? I've trying updating six with pip, but that doesn't do anything. Here's the error I see: Traceback (most recent call last): File "./quickstart.py", line 27, in <module> credentials = run(flow, STORAGE, http=http) File "/Library/Python/2.7/site-packages/oauth2client/util.py", line 137, in positional_wrapper return wrapped(*args, **kwargs) File "/Library/Python/2.7/site-packages/oauth2client/old_run.py", line 120, in run authorize_url = flow.step1_get_authorize_url() File "/Library/Python/2.7/site

NSURLConnection initWithRequest is deprecated

徘徊边缘 提交于 2019-11-28 21:32:37
I am adopting the Gmail API in iOS and I am getting the warning: initWithRequest is deprecated in the following line: connection_ = [[connectionClass alloc] initWithRequest:request_ delegate:self startImmediately:NO]; The line is in the source file GTMHTTPFetcher.m of the API library. What is the substitute for the deprecated -initWithRequest: method? It seems that the whole NSURLConnection API has been deprecated in iOS 9. Existing apps will continue to work, but new builds (linked against iOS SDK) must use the newer NSURLSession API. Ray Wenderlich has a good tutorial here . Also, of course,