gmail-api

Send HTML email with plain text fallback via Gmail API

一曲冷凌霜 提交于 2019-12-01 03:38:05
问题 An answered question at StackOverflow suggests that adding html-markup to the body of the email will do the trick. Is that solution correct? But what if the recipient's email server/client does not support HTML email? E.g. when using Apache commons email, I do the following: // set the html message email.setHtmlMsg("<html>Our logo - <img src=\"cid:"+cid+"\"></html>"); // set the alternative message email.setTextMsg("Your email client does not support HTML messages"); Is there any way to tell

Google Gmail API - Delegation settings

给你一囗甜甜゛ 提交于 2019-12-01 01:08:56
Apologies if this is covered elsewhere and I have missed it. Google's Email Settings API is deprecated and set to be turned off on July 7, 2017 . With this date looming, I have started investigating migrating our local delegated account management web application to the new API. As you might expect, this applications allows users to list, add and delete delegate access to a Gmail account. It currently uses the OAuth 2.0 scope of. https://apps-apis.google.com/a/feeds/emailsettings/2.0/{domain}/{username}/delegation However, the delegate section of the migration guide , written in July 2016,

Python: Google API - Getting mimeTypes from a message

白昼怎懂夜的黑 提交于 2019-12-01 00:21:26
My goal is to use the Google API to take data from an email I have specified. Currently I can find the message, get the message data and decode the message data into a readable format. After this I need to find the correct part of my message (type text/html ) and then scan for my link using beautiful soup . Unfortunately I don't understand enough about the structure of the email/Google API to scan for this specific part of the mail. try: message = gmail_service.users().messages().get(userId='me', id=thread['id'], format='raw').execute() print 'Message snippet: %s' % message['snippet'] msg_str

gmail api gives failedPrecondition error

烈酒焚心 提交于 2019-12-01 00:08:41
I can't get gmail api to work. I'm using server-to-server authentication with JWT. google-api-python-client==1.4.0 httplib2==0.9 oauth2client==1.4.7 pycrypto==2.6.1 My code looks like this. with open(CLIENT_SECRET_FILE) as f: data = json.loads(f.read()) private_key = data['private_key'] client_email = data['client_email'] credentials = SignedJwtAssertionCredentials(client_email, private_key, scope=OAUTH_SCOPE) http = credentials.authorize(http) gmail_service = build('gmail', 'v1', http=http) try: threads = gmail_service.users().messages().list(userId='me').execute() except Exception as e:

Gmail api with .Net CLient library: Missing draft message [400]

痞子三分冷 提交于 2019-11-30 22:59:17
I'm trying to create drafts in Gmail using the .Net Client Library. I can successfully login and retrieve a list of drafts so the authentication and api are working. Now I need to create an instance of the Draft class and send it to the API. But what does the draft message need to look like? It doesn't matter what I fill in the API explorer on https://developers.google.com/gmail/api/v1/reference/users/drafts/create , my draft is always empty. Also when doing it from my C# code I need to set the draft.Message.Raw field to something else I get an error: Missing draft message [400] Using the

Gmail api with .Net CLient library: Missing draft message [400]

China☆狼群 提交于 2019-11-30 18:12:52
问题 I'm trying to create drafts in Gmail using the .Net Client Library. I can successfully login and retrieve a list of drafts so the authentication and api are working. Now I need to create an instance of the Draft class and send it to the API. But what does the draft message need to look like? It doesn't matter what I fill in the API explorer on https://developers.google.com/gmail/api/v1/reference/users/drafts/create, my draft is always empty. Also when doing it from my C# code I need to set

Python: Google API - Getting mimeTypes from a message

淺唱寂寞╮ 提交于 2019-11-30 18:06:21
问题 My goal is to use the Google API to take data from an email I have specified. Currently I can find the message, get the message data and decode the message data into a readable format. After this I need to find the correct part of my message (type text/html ) and then scan for my link using beautiful soup. Unfortunately I don't understand enough about the structure of the email/Google API to scan for this specific part of the mail. try: message = gmail_service.users().messages().get(userId=

Base64 decoding of MIME email not working (GMail API)

╄→гoц情女王★ 提交于 2019-11-30 12:50:11
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 that resembles the HTML data but with a bunch of weird characters. Help? I'm not sure if you've solved it yet, but GmailGuy is correct. You need to convert the body to the Base64 RFC 4648 standard. The jist is you'll need to replace - with + and _ with / . I've taken your original input and did the replacement: http://hastebin.com/ukanavudaz And

Having trouble reading the text/html message part

微笑、不失礼 提交于 2019-11-30 12:08:42
I'm trying to pull out the subject and body of an email with .Net. It seems to go OK except for the text/html MessagePart. I'm not sure of the encoding etc - has anybody got this working OK? It errors for me when trying to convert. Here is the raw string for the text/html Body Data "PGRpdiBkaXI9Imx0ciI-dGV4dCBpbiBoZXJlPGJyPjwvZGl2Pg0K" which throws an error. "The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters." Here is the code: UsersResource.MessagesResource.GetRequest gr = gs

Gmail API access using Android

非 Y 不嫁゛ 提交于 2019-11-30 11:59:56
I am trying to access the Gmail API using an Android application. I have successfully requested and received an access token using all available scope combinations. But it seems that every time I actually try to use the Gmail API command I am getting a 403 exception reading: Access not configured please use Google developers console to activate the api... Needless to say the API is activated and a client key was created using the correct package name & sha1 code. Same client ID works well with Google Plus features. Anyone having this issue or succeeded in connecting to the Gmail api from