gmail

GMail API: Fastest way to get the oldest email in inbox

若如初见. 提交于 2019-12-06 13:47:16
I want to get the oldest email in GMail inbox. How can I do that with the minimum number of API calls? One way to do it could be to get the total number of emails from Users:getProfile API and then use User.messages:list API to get the last page using " pageToken " query parameter by using the formula pageToken = totalMessages/50 to get the list of messages from the last page of my inbox and then using the mid of the last message in the list to fetch the oldest email. I am just wondering if there is a better way to do this? I could not figure out other ways to do it from the documentation. Any

Need to make Javamail more secure for gmail authentication

▼魔方 西西 提交于 2019-12-06 13:34:29
I have written a code for sending a simple mail from java(javamail/jaf). after I run the program I got an email from google that my account is being accessed by unsecured device/app. Then I had to change the settings of my gmail account to allow login for "less secure apps" option. Then I received my email from the program. I need to send email without changing the option allow "less secure apps" option in my account. Please help. My code is: import java.util.Properties; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.PasswordAuthentication; import javax.mail

Getting Android Market Account programmatically

本小妞迷上赌 提交于 2019-12-06 13:02:30
To get the Android Market Account, I do so: AccountManager accountManager = AccountManager.get(this); Account[] accounts = accountManager.getAccountsByType("com.google"); androidCheckout = accounts[0].name.trim().toLowerCase(); With my phone and my credentials the above statement is fine. I've an account so masked: "something@gmail.com". My question is: I know that the accounts can be either Gmail or Google Apps accounts. And also that Google Apps accounts can have any domain name. So, in this case, instead of @gmail.com there can be everything: depending on the domain name, for instance

regex like gmail search operators - PHP preg_match

北战南征 提交于 2019-12-06 12:28:49
问题 I'm trying to implement a system similar to gmail search operators using function preg_match from PHP to split the input string . Example: input string => command1:word1 word2 command2:word3 command3:word4 wordN output array => ( command1:word1 word2, command2:word3, command3:word4 wordN ) The following post explains how to do it: Implementing Google search operators I already test it using preg_match but doesn't match. I think regular expressions may change a bit from system to system. Any

Sending an email with Gmail's API using only a token?

谁说我不能喝 提交于 2019-12-06 11:53:26
I'm trying to using Google's API to send an email. I have a web application powered by AngularJS where the user signs in with their google account (via passport.js) using oauth2. A new access token is written to their account on my database. Their google user ID is also written to their account. I'd like the user to be able to send an email via an HTTP request using simply their user Id and access token. I'm using Postman to make some test requests, but I keep getting this error: { "error": { "errors": [ { "domain": "global", "reason": "insufficientPermissions", "message": "Insufficient

Android/ListView : Select first item after loading datas

笑着哭i 提交于 2019-12-06 11:51:40
EDIT I must tell you that my ListView is populate by an AsyncTask. The code below works fine when I do in onPostExecute method : synchronized (mListView) { if(mFeeds==null || mFeeds.size()==0){ Utils.Log("mFeeds empty"); _this.setListShown(false); }else{ Utils.Log("mFeeds Full"); _this.setListShown(true); mListView.setAdapter(new ListFeedsAdapter(mActivity,mFeeds)); mListView.notifyAll(); NewsFeedsDetailViewPagerFragment fragment = (NewsFeedsDetailViewPagerFragment) getFragmentManager() .findFragmentById(R.id.feeddetailViewPagerFragment); if(fragment!=null){ mListView.performItemClick(null, 0,

PHP Mailer - SMTP GMAIL AUTHENTICATION

拥有回忆 提交于 2019-12-06 11:38:07
问题 I have problem with the PHP MAILER function. I am using GMAIL SMTP Authentication for sending email and also its working perfectly but i want to set "From" email like "myid@domainname.com" but it doesn't working properly. I used below code to set "From" email $mail = new PHPMailer(); $mail->IsSMTP(); // telling the class to use SMTP $mail->Host = "mail.gmail.com"; // SMTP server $mail->SMTPDebug = 0; // enables SMTP debug information (for testing) $mail->SMTPAuth = true; // enable SMTP

Is Gmail Lab API open?

微笑、不失礼 提交于 2019-12-06 11:36:57
I am thinking about writing a plugin for email application. It can be put on Gmail Labs. It can be thunderbird plugin or even chrome/firefox plugin. But to get the most exposure I should put it on Gmail Labs if possible. Actually, I don't know if it's possible at all. BTW, I'm aware of this . Let me know what you think. No, Gmail Labs is not open to external contributions. However, Gmail users can add external gadgets to Gmail. 来源: https://stackoverflow.com/questions/9985378/is-gmail-lab-api-open

Gmail API find parent of a draft

久未见 提交于 2019-12-06 11:35:40
How can I find the parent of a draft (if it exists) in Gmail? When the user responds to a particular message in a Gmail Thread , the draft appears directly below it. Say for example, there was 5 messages in a thread and a draft was made in reply to the 3rd one... that draft would always appear as the 4th message. I'm attempting to reproduce this in my application, but I need a way of mapping a draft to the message it is in response to if any. I've been searching through the values returned, but cannot find any reference to previous messages. How can I do this through the API? Edit: You have to

Rails send mail with GMail

天涯浪子 提交于 2019-12-06 11:21:15
I am on rails 2.3.5 and have the latest Ruby installed and my application is running well, except, GMail emails. I am trying to setup my gmail imap connection which has worked previously but now doesnt want to know. This is my code: # Be sure to restart your server when you modify this file # Uncomment below to force Rails into production mode when # you don't control web/app server and can't set it the proper way # ENV['RAILS_ENV'] ||= 'production' # Specifies gem version of Rails to use when vendor/rails is not present RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION # Bootstrap