gmail-api

How to send a draft email using google apps script

流过昼夜 提交于 2019-12-08 18:08:07
问题 I am working with Google apps script and would like to create a script which picks up mail from the drafts and sends them if they have label "send-tomorrow". Finding drafts with a certain label is pretty simple: var threads = GmailApp.search('in:draft label:send-tomorrow'); However I don't see an API to send the message! The only option I see is to: - open the message - extract body/attachments/title/from/to/cc/bcc - send a new message with the above params - destroy the previous draft which

Emails/drafts sent via Gmail REST API can't be opened in the new Gmail UI

南楼画角 提交于 2019-12-08 15:47:17
问题 When sending drafts via the Gmail REST API, the message in the "Sent Mail" folder can't be opened by the sender in the new Gmail UI. You get the error message "The conversation that you requested could not be loaded." . The message on the recipient side can be opened without problem though, new UI or not. Reverting to the old/classic Gmail UI allows the sender to open the sent message. Steps to reproduce: Compose a draft in Gmail (new or old UI doesn't matter) Find the draft ID via GET https:

Efficient way of syncing Gmail Inbox messages using the new Gmail API?

隐身守侯 提交于 2019-12-08 13:54:20
问题 A web application sends an email on behalf of a UserA to UserB , using the new Gmail API ( Users.messages: send ). The synchronous response contains threadId , messageId which are stored in the database. We then query the history API for any changes in user's inbox ( Users.history: list ). Is there an efficient way to get all the updates since last sync (new replies, read/unread changes)? One implementation that we tried was to filter the history API results through a custom label.

Chinese Characters Included in Subject When GMail Sends Mail Can't Be Displayed Correctly

强颜欢笑 提交于 2019-12-08 13:35:50
问题 I send a mail in javascript via GMail API. If mail subject has Chinese Characters,it cant't display correctly in GMail Inbox. And message has Chinese Characters no problem. var email = ''; email = 'Content-Type: multipart/mixed;boundary="foo_bar_baz"\r\n'+ "To: " + $('#compose-to').val() + "\r\n" + "Subject: 这里是中文字符" +"\r\n\r\n"; email += "--foo_bar_baz\r\n" + "Content-Type: text/html;charset='UTF-8'\r\n" + "Content-Transfer-Encoding: 8bit\r\n"; email += "\r\n" + $('#compose-message').val()+"

How to send GTLRGmail_Message with attachment

无人久伴 提交于 2019-12-08 13:20:31
After searching a while i have manage to send a email but without attachment as follows: NSString *messageString = @"From: \"From Email USer Name\" <fromEmail>\r\n"; messageString = [messageString stringByAppendingString:@"To: \"To Email User Name\" <ToEmail>\r\n"]; messageString = [messageString stringByAppendingString:@"Subject: New stuff\r\n"]; messageString = [messageString stringByAppendingString:@"Content-type: text/html;charset=iso-8859-1\r\n\r\n"]; messageString = [messageString stringByAppendingString:@"Hello my friend, \n can you please call me when have free time. \nMark."]; NSData

Is there any google API which could save gmail message attachments to google drive?

为君一笑 提交于 2019-12-08 12:41:19
问题 How can I save gmail message attachments to google drive. Is there any such google API? 回答1: To add details, here is the main page of what Google APIs you can use. As Gaurav mentioned, you can use Drive and Gmail API. Here is a snippet using Apps Script: // GLOBALS //Array of file extension which you would like to extract to Drive var fileTypesToExtract = ['jpg', 'tif', 'png', 'gif', 'bmp', 'svg']; //Name of the folder in google drive i which files will be put var folderName = 'GmailToDrive';

Creating label with id via Google Gmail API

家住魔仙堡 提交于 2019-12-08 10:45:08
问题 I am trying to create a label with a custom id using the node library for the Gmail API. The API has a request parameter for setting your own id however when I try to create the label I get the error: { "error": { "errors": [ { "domain": "global", "reason": "invalidArgument", "message": "Invalid request" } ], "code": 400, "message": "Invalid request" } } The label is created with no problems when I don't give an id. However for my purposes I need to have a set standard label id. Anyone know

how to get email address using this scope from google plus integration

痴心易碎 提交于 2019-12-08 09:39:24
问题 I tried this URL https://www.googleapis.com/auth/userinfo.profile in android oauth, while google plus integration in my application. Getting the following json and this json array does't contain the email address like this profile{"displayName":"Devarajan Mahalingam","gender":"male", "id":"101222514586833333269", "image":{"url":"https://"} am getting all details except email address.I need to get email address.. 回答1: You need to parse the scope like this String SCOPE = "https://www.googleapis

How do we add new button to gmail compose bar in chrome extension? Is it through javascript or some gmail apis? [closed]

十年热恋 提交于 2019-12-08 08:17:02
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . I am trying to come up with a chrome extension to add some functionality to gmail. I have been using any.do and wanted to understand how can we do something similar? Do we inject our new div element in the DOM or are there any gmail apis through which I can add a new button and

Failed sending mail through google api

假如想象 提交于 2019-12-08 06:40:16
问题 I've been trying to send emails using Google's Gmail API and I kept getting the following error: The API returned an error: Error: 'raw' RFC822 payload message string or uploading message via /upload/* URL required I did the setup using the starter code Google gave for NodeJS (documentation). const google = require('googleapis'); const googleAuth = require('google-auth-library'); const Base64 = require('js-base64').Base64; // ... // create the email string const emailLines = []; emailLines