gmail-api

Mail attachment wrong media type Gmail API

两盒软妹~` 提交于 2019-12-17 06:12:13
问题 I'm trying to send a message with a jpeg file attached through the Gmail API in Javascript client side. The code I've written so far is as follows: $.ajax({ type: "POST", url: "https://www.googleapis.com/upload/gmail/v1/users/me/messages/send?uploadType=multipart", headers: { 'Authorization': 'Bearer ' + accessToken, 'Content-Type': 'multipart/related; boundary="foo_bar_baz"' }, data: data }); Where data is a string built up like the example found here: --foo_bar_baz Content-Type: application

Mail attachment wrong media type Gmail API

◇◆丶佛笑我妖孽 提交于 2019-12-17 06:12:04
问题 I'm trying to send a message with a jpeg file attached through the Gmail API in Javascript client side. The code I've written so far is as follows: $.ajax({ type: "POST", url: "https://www.googleapis.com/upload/gmail/v1/users/me/messages/send?uploadType=multipart", headers: { 'Authorization': 'Bearer ' + accessToken, 'Content-Type': 'multipart/related; boundary="foo_bar_baz"' }, data: data }); Where data is a string built up like the example found here: --foo_bar_baz Content-Type: application

GMAIL API for sending Email with attachment

萝らか妹 提交于 2019-12-17 05:13:05
问题 i' m working on a javascript client able to read a CSV which contains an image url list. I m able to read the csv by the means of jquery-csv and to draw each image in a html5 canvas. The next step is to apply to each image a text layer and to send the image by email using gmail api. So my diffifulty is to find an example showing me how to take a canvas and to attach it to an email using only javascript. Do have i to build a json according to the multipart gmail guidelines and to send it as

How do I authorise an app (web or installed) without user intervention?

和自甴很熟 提交于 2019-12-16 18:16:43
问题 Let's say that I have a web app that needs to access Drive files in a background service. It will either own the files it is accessing, or be run in a Google Account with which the owner has shared the documents. I understand that my app needs a refresh token, but I don't want to write the code to obtain that since I'll only ever do it once. NB. This is NOT using a Service Account. The app will be run under a conventional Google account. Service Account is a valid approach in some situations.

How do I authorise an app (web or installed) without user intervention?

丶灬走出姿态 提交于 2019-12-16 18:16:07
问题 Let's say that I have a web app that needs to access Drive files in a background service. It will either own the files it is accessing, or be run in a Google Account with which the owner has shared the documents. I understand that my app needs a refresh token, but I don't want to write the code to obtain that since I'll only ever do it once. NB. This is NOT using a Service Account. The app will be run under a conventional Google account. Service Account is a valid approach in some situations.

No 'Access-Control-Allow-Origin' when access gmail api

南楼画角 提交于 2019-12-14 02:25:54
问题 I am using spring oauth2 and angular for this test. Spring boot app is on port 8081 and Angular is on 4200, I've setup CORS for port 4200 on Spring. When I click on Gmail button, Spring isn't give any exception, only on chrome, I got the No 'Access-Control-Allow-Origin' Error. Java code: @Autowired private OAuth2ClientContext oauthClientContext; @Value("${cross-origin-url}") private String crossOriginUrl; @Override protected void configure(HttpSecurity http) throws Exception { // TODO Auto

Error when trying to send an email using Gmail API in Java

非 Y 不嫁゛ 提交于 2019-12-14 01:22:13
问题 I want to send an email using Gmail API (not JavaMail). I read many similar topics on forums, but I have still a problem. First I read this: https://developers.google.com/gmail/api/guides/sending and I impelemented methods: MimeMessage createEmail, Message createMessageWithEmail and Message sendMessage Then I noticed that I don't have definition of object Gmail service, so I needed a class GmailQuickstart, which is here: https://developers.google.com/gmail/api/quickstart/java and I

Token invalid - Invalid token: Cannot parse referred token string: Invalid gaia_data.AuthSubToken proto on base64 token

℡╲_俬逩灬. 提交于 2019-12-14 01:21:45
问题 I've strage issue with google spreadsheet via Java application. I had application created which was working without any issue for more than 1 year I even posted an solution for Google API change under Create Spreadsheet using Google Spreadsheet API in Google drive in Java Yesterday I don't know why but it stopped working and now I've only exception: Exception in thread "main" com.google.gdata.client.GoogleService$SessionExpiredException: Token invalid - Invalid token: Cannot parse referred

Example of creating a draft with an attachment in C#?

烈酒焚心 提交于 2019-12-13 22:17:52
问题 I've written a test application in C# that creates a draft message using the new Gmail API. It works fine when the message has no attachment. I'm moving from the IMAP API and have used the MailBee.NET components with that API. The MailBee.NET components includes a class that produces an RFC 2822 message, so I've re-used this and have Base64-encoded the message and have assigned to the "Raw" property as described here: https://developers.google.com/gmail/api/guides/drafts MailMessage msg = new

Converting a Gmail API Message into an OpenPop Mime message

老子叫甜甜 提交于 2019-12-13 19:36:18
问题 Is it possible to convert a Gmail API Message into an OpenPop Mime Message? Currently, I have: List<Message> messagesList = new List<Message>(); List<string> rawMessagesList = new List<string>(); foreach(Message m in messages) { Message m2 = service.Users.Messages.Get("me", m.Id).Execute(); string m3 = service.Users.Messages.Get("me", m.Id).Execute().Raw; messagesList.Add(m2); rawMessagesList.Add(m3); } string rMessage = rawMessagesList[0]; byte[] byteMessage = Encoding.ASCII.GetBytes