Google mail IMAP interface allows mail clients, and software developers to access google mail using the IMAP standard.
Questions tagged [gmail-imap]
652 questions
8
votes
1 answer
Creating a Draft message in Gmail using the imaplib in Python
I want to write a python module that sends data to a draft message in a G-mail account. I have written a script about two weeks ago that worked perfectly using imaplib. A simplified example of my module is below. (I have created a test email address…

Mink
- 438
- 8
- 14
8
votes
2 answers
Deleting a message over imap using curl
I am working on a project where I need to read messages in an inbox on an imap server, process it and then delete the email from the inbox.
I can successufully get the email without any issue, the problem I am having is the delete.
I can fetch the…

Boardy
- 35,417
- 104
- 256
- 447
8
votes
2 answers
Gmail IMAP : Any way to find all Labels (folders) a particular message is in?
So, Gmail's IMAP is a bit 'weird'. They use IMAP folders to represent Labels. I believe typically that an email in IMAP can only belong to one 'Folder', however with Gmail, an email message can belong to many 'folders' which gives us very close…

Redth
- 5,464
- 6
- 34
- 54
8
votes
1 answer
IMAP search by subject fails on punctuation characters on Gmail
I am using the PHP IMAP libraray's imap_search() function to search mails in a Gmail inbox via the subject string.
imap_seach($mbox, 'ALL SUBJECT "<search string>"');
This search returns perfectly fine for alphanumeric strings but fails when…

Nands
- 1,541
- 2
- 20
- 33
8
votes
2 answers
Integrating IMAP on php website
I am trying to create a IMAP service on my website with help of php. It basically has few steps.
The main part that I want is that i get a list of folders of gmail account, on the click of a particular folder, the list of mails in that folder should…

Sam
- 1,381
- 4
- 30
- 70
8
votes
2 answers
Gmail push notifications in Rails
I am developing an application where users add their Gmail accounts, and I do some classification work on their emails.
I want to be notified when a new email comes to any of the registered accounts.
A solution is to keep polling the accounts via…

Shakes
- 179
- 1
- 9
7
votes
5 answers
How would I move a message from Gmail Inbox to a label?
I'm trying to move messages away from Inbox into Processed label with this code:
$inbox = imap_open($host,$user,$pass) or die('Error: ' . imap_last_error());
if( $emails = imap_search($inbox,'ALL') )
{
foreach($emails as $email_number) {
…

Henno
- 1,448
- 4
- 18
- 30
7
votes
1 answer
PHP: Gmail's messages contain invalid HTML and random jargon
I'm creating an email-based CMS with PHP, and I'm required to use Gmail as the email service. The script is insanely simple for now, and the only problem I'm having is dealing with Gmail's email syntax.
I was expecting something a bit more…

Blender
- 289,723
- 53
- 439
- 496
7
votes
4 answers
Problem deleting emails in gmail using imaplib
I try to remove message from inbox folder and all alright, but when i switched to All Mail folder the removing does not work. expunge() method returns ('OK', [None]) and message was not removed:
>>>import imaplib
>>>server =…

Michael Girnyak
- 107
- 1
- 2
- 6
7
votes
3 answers
Error: channel gmail-sent: slave sent cannot be opened
I'm able to sync my Gmail inbox, but the sent folder does not work.
This is my .mbsyncrc
IMAPStore martinstabenfeldt-remote
Account martinstabenfeldt
MaildirStore martinstabenfeldt-local
Path ~/.mail/martinstabenfeldt/
INBOX…

martins
- 9,669
- 11
- 57
- 85
7
votes
1 answer
GmailService create Watch() getting User not authorized error
this this code snniped:
credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
GoogleClientSecrets.Load(stream).Secrets,//read from client secret.json file
Scopes,
"user",
…

Dima
- 287
- 1
- 10
7
votes
2 answers
Why am I getting "Web Login Required" message while connecting to Gmail via IMAP?
I'm trying to connect and retrieve a list of message headers from Gmail via IMAP.
I'm getting a response from Google with "Web Login Required" and then a URL to continue the sign-in via the web interface. Log: http://hastebin.com/odufaducew.vhdl
Why…

Andy Hin
- 30,345
- 42
- 99
- 142
6
votes
1 answer
Gmail Imap authentication using AccountManager
Using the code below I am able to get a token from the AccountManager. I am not able to figure out how to use this token with the javamail (IMAP) api for android (Session, Store, Folder,..) ?
I would like to authenticate Gmail IMAP using the account…

Hemanshu Bhojak
- 16,972
- 16
- 49
- 64
6
votes
3 answers
IMAP "Invalid Credentials" via GMail XOAUTH
I'm trying to get into the IMAP server with OAuth, using the PHP Sample Code provided by Google which uses the Zend Imap class but I am failing to authenticate. Zend is giving me the error:
Zend_Mail_Storage_Exception [ Error ]: cannot select INBOX,…

Phil Sturgeon
- 30,637
- 12
- 78
- 117
6
votes
1 answer
IMAP SEARCH complex query
I need to find all mails in IMAP mailbox which contains somestring in BODY and is FROM someone@me.com or TO someone@me.com.
Trying to do:
49:51.53 > JBPM3 SEARCH CHARSET utf-8 "BODY \"somestring\" (OR (TO \"someone@me.com\") (FROM…

Oleksandr
- 101
- 1
- 2
- 4