Questions tagged [gmail-api]

Use the Gmail API to add Gmail features to your app. RESTful access to threads, messages, labels, drafts and history. Easy to use from modern web languages.

Gmail API() gives you flexible, RESTful access to the user's inbox, with a natural interface to Threads, Messages, Labels, Drafts, and History. From the modern language of your choice, your app can use the API to add Gmail features like:

  • Read messages from Gmail
  • Send email messages
  • Modify the labels applied to messages and threads
  • Search for specific messages and threads

References:

4233 questions
19
votes
9 answers

How to get full message body in Gmail?

I want to get full message body. So I try: Message gmailMessage = service.users().messages().get("me", messageId).setFormat("full").execute(); That to get body, I try: gmailMessage.getPayload().getBody().getData() but result always null. How to…
somebody
  • 1,077
  • 5
  • 14
  • 32
18
votes
1 answer

As a recipient, is it possible to detect if an email was sent via Gmail's "Schedule Send" vs. "Send"?

Just curious if the email headers are marked by Gmail to denote if the email was scheduled vs sent right away.
xd1936
  • 1,038
  • 2
  • 9
  • 27
18
votes
3 answers

Forward mail using gmail API

Is there any code provided by google to forward mail. because i haven't found one. If there is any way to forward mail using GMAIL API with extra content to send with original message. Please help.
Rider
  • 463
  • 1
  • 9
  • 19
18
votes
2 answers

Attribute Error trying to run Gmail API quickstart in Python

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…
rstackhouse
  • 2,238
  • 24
  • 28
18
votes
1 answer

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

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 URLhttps://mail.google.com/mail/#drafts?compose=[message-id]. However I would like to open a…
cao
  • 997
  • 9
  • 17
17
votes
3 answers

GMail API - Can I send email using the Service Account?

When I send an email using the GMail API, I get an Access Token for the user to whom the message is to be sent and then when sending the message, I put some value in the From Field. But no matter what I put in the from field, the message in the…
ND003
  • 726
  • 1
  • 8
  • 22
17
votes
3 answers

Create Spreadsheet using Google Spreadsheet API in Google drive in Java

I had created some tool which was populating the google spreadsheet. It was working fine for 1 year, since today I've error Exception in thread "main" com.google.gdata.util.AuthenticationException: Error authenticating (check service name) at…
Skwarosz
  • 369
  • 1
  • 2
  • 8
17
votes
1 answer

Send HTML message using gmailr

I want to be able to use the gmailR package to send R-generated HTML reports via email inline(not as attachments). I'm unable to even send a basic HTML email using gmailr. I've attempted the following unsuccessfully and need some…
Jack Case
  • 329
  • 2
  • 13
17
votes
7 answers

Base64 decoding of MIME email not working (GMail API)

I'm using the GMail API to retrieve an email contents. I am getting the following base64 encoded data for the body: http://hastebin.com/ovucoranam.md But when I run it through a base64 decoder, it either returns an empty string (error) or something…
Andy Hin
  • 30,345
  • 42
  • 99
  • 142
16
votes
5 answers

How does a Gmail message Id or ThreadId map to the new Gmail UI?

Edit: addressing the first comment below and for clarity, this isn't a code question. The question is simply: What do I put into the URI querystring of the new Gmail UI to view a draft message created by the Gmail API? Despite this not really being…
Chris Wood
  • 521
  • 6
  • 13
16
votes
1 answer

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?

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…
Steve Bazyl
  • 11,002
  • 3
  • 21
  • 24
16
votes
2 answers

Attachment missing from message sent with Gmail API but only for recipient

When calling the Gmail API in JavaScript to send a message with an HTML body and a ~100KB PDF attachment, the attachment correctly appears attached to the message in the sender's Gmail Sent folder, but does not appear on the message for the…
Employee
  • 2,231
  • 3
  • 33
  • 60
16
votes
7 answers

How to get access token using gmail api

I got the authorization code following this document. But when I tried to get access token, I always got errors. Can anyone help me ? public String AccessToken() { String accessToken = ""; StringBuilder strBuild = new StringBuilder(); …
tqjustc
  • 3,624
  • 6
  • 27
  • 42
16
votes
3 answers

NSURLConnection initWithRequest is deprecated

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…
Aditya Borde
  • 1,227
  • 2
  • 12
  • 31
15
votes
2 answers

How to filter messages that do NOT have attachments using GMail query language?

How do I filter out Gmail messages that DO NOT have attachments? Here is the documentation I'm trying to follow. I can see that in order to include messages with attachments, I use the following query: has:attachment However, I do not see a way to…
Let Me Tink About It
  • 15,156
  • 21
  • 98
  • 207