gmail-api

Reading messages from Gmail, in PHP, using Gmail API

不羁的心 提交于 2019-11-28 20:37:30
I have donwloaded new Gmail API source code from Google PHP client library. I inititalized the service using: set_include_path("./google-api-php-client-master/src/".PATH_SEPARATOR.get_include_path()); require_once 'Google/Client.php'; require_once 'Google/Service/Gmail.php'; $client = new Google_Client(); $client->setClientId($this->config->item('gmailapi_clientid')); $client->setClientSecret($this->config->item('gmailapi_clientsecret')); $client->setRedirectUri(base_url('auth')); $client->addScope('email'); //$client->addScope('profile'); $client->addScope('https://mail.google.com'); $client-

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

不想你离开。 提交于 2019-11-28 19:39:29
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 a code question, I'm asking on Stack Overflow as it's Google's preferred platform for Gmail API questions. -- If I view a draft message in the new Gmail UI, the URI is something like this: https://mail.google.com/mail/u/1/?zx=iij9apqgzdf4#drafts?compose=jrjtXSqXwlFGnSGCQgDCdnHGVFdlpFMgzsCNgpQstQLxdLCMkjKstBmWZkCmjhWTQnpsZCJF I can't see any way to

Retrieve email/message body in html using Gmail API

随声附和 提交于 2019-11-28 17:10:28
问题 Is there any way to retrieve message body in html form using GMail api ? I have already gone through the message.get docs. Tried changing the format param to full , minimal & raw . But it did not help. It's returning the plain text of mail body. Description of format values: "full": Returns the parsed email message content in the payload field and the raw field is not used. (default) "minimal": Only returns email message metadata such as identifiers and labels, it does not return the email

GMAIL API : How to get the reply without the original message

回眸只為那壹抹淺笑 提交于 2019-11-28 14:29:22
i'm using google api for gmail. All is working fine, i was able to connect, list and get message / thread, browse every elements of a thread etc... I want to be able to retrieve a reply without the original message, is it somehow doable ? I think that every email software will put together a different constructed reply message with the original message included but maybe there's a way to retrieve only the reply. Thanks for any hint that will allow me to do such thing. Dan Klos It appears the consensus is that this is not possible , and that the message/thread must be parsed manually with your

GMail API Emails Bouncing

女生的网名这么多〃 提交于 2019-11-28 13:31:28
Using GMail API in .Net. Creating messaging using Net.Mail.MailMessage. Then using MimeKit to create MimeMessage (using this to send attachment + HTML message). Passing MimeMessage.ToString to Base64 encoder. No API error. Code runs through ok. I can see the message in the sent page in GMail. Mail looks perfect (and the send actually return message id). But then there is the following appended message to this mail in Gmail. Bounce <nobody@gmail.com> An error occurred. Your message was not sent. As usual, no other information from Google. How to fix this? Dim msg = New Net.Mail.MailMessage msg

Gmail API In-Reply-To not working(Google not handling on one side)

一世执手 提交于 2019-11-28 13:26:35
Problem: When Reply to email is sent via api then in receiver side it is showing as thread that contains two email messages( good on receivers side ) but the sender has two different emails one in Inbox and one in Sent Mail( Problem in sender side ). for example: Email is sent from A to B. Again B sends to A. here in api i am giving the previous email message-id in "In-Reply-To" and "References",(according to rfc822 format) here Google is handling that message-id on the A side but not on B side. A receives the message in a single thread as two messages but in B's account it is showing as two

GmailApp - Add label to specific message, not the thread

吃可爱长大的小学妹 提交于 2019-11-28 13:02:20
I'm building a script to automatically move my emails from one label to the next on a day by day basis (so that a message that is stored labelled "5 days" will automatically be labelled "4 days" tomorrow then "3 days" the day after that, and so on). The problem is that it applies the label to the entire thread, not just the message - which is problematic if you have Conversation View turned off and the various emails seperated under different labels. Here is my script (which has a daily trigger): function moveUp(previousLabel, newLabel) { var threads = GmailApp.getUserLabelByName(previousLabel

How to send big attachments with gmail API

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 12:36:30
问题 i'm trying to send an email with Gmail API. I'm able to send it with smaller files successfully. Problem appears when I try to send attachment with bigger size. It's been couple of hours I'm trying different solutions. Before it was giving error Error 413: Request Entity Too Large . I updated my code and it looks like this: $mime = rtrim(strtr(base64_encode($mime), '+/', '-_'), '='); $msg = new Google_Service_Gmail_Message(); $msg->setRaw($mime); $sendOptions = [ 'uploadType' => 'resumable' ]

MIME Headers Not Making it Through Gmail API

只愿长相守 提交于 2019-11-28 12:22:14
I'm trying to automate the creation of drafts via the Gmail API, and I want these drafts to be responses to existing emails. To do this, I believe I need to set the "threadId" header (Gmail specific), the "References" header, and the "In-Reply-To" header. Additionally, for Gmail to consider the message to be a reply, the "Subject" header must match the original email. I'm hardcoding all of these headers into a MIMEText object, and then base-64 encoding (urlsafe) the message as a string and having the Gmail API deliver it. However, the "threadId", "In-Reply-To", and "References" headers don't