gmail-imap

PHP IMAP retrieve all recipients in To address

荒凉一梦 提交于 2020-01-04 02:52:14
问题 Using PHP IMAP I am able to download all my messages attachments etc from gmail. But when there are multiple recipients in the to address I am only getting a single address. Let me explain it more clearly. Suppose I have an email address example@gmail.com from where I am downloading all the messages. Now when test@gmail.com sends an email to me I am getting example@gmail.com in the toaddress using function imap_headerinfo. But when test@gmail.com sends the mail to example@gmail.com and

Google App Engine (GAE) message.getContent() using javamail and IMAP not works

对着背影说爱祢 提交于 2020-01-03 01:46:08
问题 I have several days trying to get the contents of a message through IMAP on a Google App Engine Project. I managed to extract all the other information, but to extract the contents of jumps me an error message (not work even invoking message.getContent.tostring(), I've tried as MultiPart). I perform the same action from a normal project , (not GAE and using javamail.1.4.7), the content of the messages shown perfectly. This is the code of GAE project: import java.util.Properties; import java

Search utf-8 string with Gmail X-GM-RAW IMAP command

允我心安 提交于 2020-01-02 15:14:39
问题 Gmail's imap extension command X-GM-RAW allows me to perform a search if I use a ascii query string. If utf-8 chars are used in the query, the imap returns bad response. https://developers.google.com/google-apps/gmail/imap_extensions#extension_of_the_search_command_x-gm-raw How should the utf-8 input string be encoded so that X-GM-RAW search will work fine. I do not want to loose the flexibility to search specific field like "subject" or "rfc833msgid" Thanks 回答1: Specify CHARSET UTF-8 and

Search utf-8 string with Gmail X-GM-RAW IMAP command

限于喜欢 提交于 2020-01-02 15:14:00
问题 Gmail's imap extension command X-GM-RAW allows me to perform a search if I use a ascii query string. If utf-8 chars are used in the query, the imap returns bad response. https://developers.google.com/google-apps/gmail/imap_extensions#extension_of_the_search_command_x-gm-raw How should the utf-8 input string be encoded so that X-GM-RAW search will work fine. I do not want to loose the flexibility to search specific field like "subject" or "rfc833msgid" Thanks 回答1: Specify CHARSET UTF-8 and

Error code 400 on generating OAuth 2 SASL string

瘦欲@ 提交于 2019-12-30 12:13:29
问题 I have generated the following SASL string FOR OAuth 2: user=designadmin@mydesign.mygbiz.com^Aauth=Bearer ya29.AHES6ZTtYOu0NR0vAYbrvKZNcHJPuZEpr4Hk3W3dXcXFQ88^A^A Then i encoded it and sent the encoded string like this: MSB AUTHENTICATE XOAUTH2 encoded string But i get error response as: {"status":"400","schemes":"Bearer","scope":"https://mail.google.com/"} What does this error mean and how can i correct it? 回答1: I finally figured it out. In my case, the Gmail scope("https://mail.google.com/"

How do you add an email filter to an IMAP email account?

萝らか妹 提交于 2019-12-25 06:26:35
问题 I'm using PHP (zend_mail_storage_imap specifically). I built the first iteration of an email product a few days ago. Basically, I flag and filter a number of emails using zend_mail and an imap email account. The problem is that I'm currently searching the email address every five minutes to see if a new email was received. I'd like to change this by placing a filter in IMAP itself - a filter similar to GMAIL filters. Would this be possible to set this up directly in IMAP? If not, what would

Gmail XOAUTH 2.0, IMAP AUTHENTICATE returns “status”:“400”

有些话、适合烂在心里 提交于 2019-12-25 06:13:22
问题 I'm trying to use XOAUTH2 to authenticate IMAP calls to Gmail (yes I'm aware there is a Gmail API but I have my reasons to stick to IMAP). I get a valid token by either using: GoogleAuthUtil.getToken(Context context, String account, "oauth2:" + GmailScopes.MAIL_GOOGLE_COM) or GoogleAccountCredential credential = GoogleAccountCredential.usingOAuth2( context, Arrays.asList(SCOPES)) .setBackOff(new ExponentialBackOff()) .setSelectedAccountName(account); credential.getToken(); They both return

Is there a way to tie emails together other than by the “Subject” text?

拜拜、爱过 提交于 2019-12-25 04:16:11
问题 I want to tie email "threads" together programmatically, specifically gmail and yahoo email "conversations." Is there a way to do this (some kind of link or pointer or "thread ID" contained within an email), or am I stuck with relying on the emailers not changing the text in the "Subject" line? And besides, that trick would be barely functional at all, as many unrelated threads may have the same subject (such as "[no subject]" etc.). 回答1: Yes. EMails contain a header (message ID), that is a

Oauth2 token not working for gmail_xoauth gem

a 夏天 提交于 2019-12-24 11:36:21
问题 I'm currently getting a token via the omniauth-google-oauth2 gem per the following: https://github.com/zquestz/omniauth-google-oauth2 I store the token that comes back from the auth_hash . I then try to use the token by calling: require 'gmail_xoauth' imap = Net::IMAP.new('imap.gmail.com', 993, usessl = true, certs = nil, verify = false) imap.authenticate('XOAUTH2', 'myemail@gmail.com', Token.last) Problem is that I get an error: [8] pry(main)> imap.authenticate('XOAUTH2', 'myemail@gmail.com'

Why can't I send emails to multiple recipients with this script?

大兔子大兔子 提交于 2019-12-24 09:58:25
问题 Why can't I send emails to multiple recipients with this script? I get no errors nor bouncebacks, and the first recipient does receive the email. None of the others do. The script: #!/usr/bin/python import smtplib SMTP_SERVER = 'smtp.gmail.com' SMTP_PORT = 587 recipient = 'email@domain.com; email2@domain.com;' sender = 'me@gmail.com' subject = 'the subject' body = 'the body' password = "password" username = "me@gmail.com" body = "" + body + "" headers = ["From: " + sender, "Subject: " +