gmail-api

Categorizing Gmail messages based on the time user spent reading the message

天涯浪子 提交于 2019-12-11 12:06:00
问题 I am looking for the following feature in Gmail. For each message I open, it tracks the time I spent reading the message when it is feasible to do so. For example, if I open message 1 and then move to message 2, by clicking a button within 2 seconds, it notes that the time spent on message 1 is less than 2 seconds. Gmail automatically labels the messages on which the User spends less than some configurable amount of time (say 2 seconds) and assigns them a label, say "LowAttentionSpan". This

Using PHP to access Gmail using Service Account

南笙酒味 提交于 2019-12-11 11:56:50
问题 I am trying to list emails from a standard Gmail account (not a Google Apps account) using OAuth2 and a Service Account (actually, I want to send emails – but that can wait). I have created the Project, created the service account, downloaded the private key, and enabled the Gmail API (and the Calendar API). I can successfully access my calendar using code very similar to the code below. However, I am receiving the following error when attempting to list mail messages. Error refreshing the

Google AUTH API Application Type, how important is it?

浪子不回头ぞ 提交于 2019-12-11 11:48:10
问题 I've been doing a lot tinkering around with the authentication stuff using the .NET libraries provided by Google. We have both a desktop and web-app side, and what we want to achieve is to authenticate ONCE, either on the desktop or the web side, and store the refresh token, and reuse it both on the web side and the desktop side. So the situation is like so, on the desktop side, when there's no saved existing AccessToken's and RefreshToken's, we will ask the user to authenticate via this code

Gmail Api send text and html in one mail

妖精的绣舞 提交于 2019-12-11 10:52:09
问题 Mail sending either text or html works perfectly fine, but when i send them both in single mail, html comes as an attachment named "noname.html", which contains html. I have read other related questions on this topic, but couldn't find what is possibly wrong. MIME-Version: 1.0 From: sender@gmail.com To: receiver@gmail.com Subject: test Content-type: multipart/mixed; boundary="012boundary" --012boundary Content-type: text/plain; charset="UTF-8" Hello plain text! --012boundary Content-type:

Server-side OAuth for user impersonation via GMail API

一曲冷凌霜 提交于 2019-12-11 10:43:42
问题 I am trying to perform server-side OAuth so I can use a specific user account in my domain to send emails (hence using GMail API) via my application. Mine is a purely server-side app and I cannot perform "user consent" via a UI. I have created a project in Google App Engine and have obtained service account credentials (P12 key). My code looks like this - new GoogleCredential.Builder() .setTransport(httpTransport) .setJsonFactory(JSON_FACTORY) .setServiceAccountId

Gmail Api send from alias

限于喜欢 提交于 2019-12-11 09:46:25
问题 I created a script that connects with the Gmail API using OAuth 2.0. It works perfectly, and I am able to send email from the authenticated account. However, I can't send email from any of the account's aliases. If I try to do so I get the following error message: "error": { "errors": [ { "domain": "global", "reason": "forbidden", "message": "[ACCOUNT] does not have privileges to [ALIAS] mailbox." } ], "code": 403, "message": "[ACOUNT] does not have privileges to [ALIAS] mailbox." } } I have

Gmail API: Triggering in-webpage refresh

僤鯓⒐⒋嵵緔 提交于 2019-12-11 09:42:59
问题 I'd like to trigger the in-webpage refresh button programmatically for the purpose of applying labels to emails without making the user manually refresh the page or make some other page action in order to see the labels. Is this possible to do? All of the documentation I am finding is surrounding refresh tokens, which is obviously something different. Thank you for your time. 回答1: There's no way to do that from the Gmail REST API (i.e. trigger refresh action in web browser viewing the gmail

Send large attachment with Gmail API

廉价感情. 提交于 2019-12-11 08:45:03
问题 According to Gmail API to send an email with large attachments bigger then 5MB you need to use the instructions here: https://developers.google.com/gmail/api/guides/uploads The API is a not very clear about the details and I tried to use the explanation I found here: Gmail API PHP Client Library - How do you send large attachments using the PHP client library? I get " Entity too large " error message every time. Someone can succeded to send an attachment bigger than 5MB with Gmail API, and

TypeError: Cannot find function hasNext in object

雨燕双飞 提交于 2019-12-11 07:44:27
问题 I'm trying to save an email in to a particular drive folder however getting error message TypeError: Cannot find function hasNext in object Any idea how I can overcome this. function saveGmailToDrive() { var gmailLabels = "SaveToDrivetest"; var driveFolder = "Emails saved by " + Session.getActiveUser().getEmail() /* Gmail Label that contains the queue */ var label = GmailApp.getUserLabelByName(gmailLabels) ? GmailApp.getUserLabelByName(gmailLabels) : GmailApp.createLabel(gmailLabels); var

Error in sending Email in Google AppMaker

≯℡__Kan透↙ 提交于 2019-12-11 07:35:40
问题 I want to send an email notification whenever the user clicks on a button. The button will call sendEmail(widget) function and invoke a client script as follow: function sendEmail(widget){ var item = widget.datasource.item; google.script.run .withFailureHandler(function(error) { console.text = error.message; }) .withSuccessHandler(function(result) { console.text = 'succeed'; }) .sendEmails(item); } then it will pass the datasource on item and call sendEmails(item) function from a server