IMAPClient aims to be a easy-to-use, Pythonic and complete IMAP client library with no dependencies outside the Python standard library.
Questions tagged [imapclient]
68 questions
0
votes
0 answers
imaplib.IMAP4.error: FETCH command error: BAD [b'Command Error. 10']
I get an error when trying to fetch emails from sent items while it works perfectly when I fetch emails from INBOX.
Anyone has the same issue?
thank you all.
import imapclient, pprint , pyzmail ,re
import socket
out =…

Alani
- 73
- 6
0
votes
1 answer
Using IMAPClient Search for keyword in subject?
Below returns unseen emails and their respective subject lines. How do I only return unseen email subject lines that match a keyword?
Any help would be appreciated, many thanks in advance....
import email
from imapclient import IMAPClient
HOST =…

Dataman X
- 11
- 1
0
votes
0 answers
KeyError: b'X-GM-LABELS' Issue when adding a label to an email
I'm using IMAPclient. After I return an imapclient object I pass it to the function below together with the id of the email and a string of the label I want the email to be labeled with.
This works in general but I get this error in a few…
0
votes
0 answers
Storing SSL socket connection for reusability Python
I am using IMAPClient library for fetching emails.
In my application i have multiple options where i have to always create a socket connection or login to email account using IMAPClient.
Read mail
Fetch mail
Fetch folders
etc
For each options my…

shashank verma
- 303
- 1
- 3
- 9
0
votes
0 answers
Python IMAPClient proxy
I am writing a simple checker based on IMAPClient. In a loop, we go line by line from the file, divide by login \ password, and substitute it into IMAPClient. The problem is as expected with the handshake from the server. It is necessary to change…

Zepterus
- 1
0
votes
2 answers
Getting rid of certain text from the body of an email using Python
I'm trying to parse the body of a forwarded email using the following Python code
import imapclient
import os
import pprint
import pyzmail
import email
#my email info
EMAIL_ADRESS = os.environ.get('DB_USER')
EMAIL_PASSWORD =…

Victor Salazar
- 3
- 1
0
votes
1 answer
List Index be out of range in a for i in List loop using IMAPClient?
I'm not sure if I'm missing something obvious. I am trying to retrieve emails and iterate over them to find specific items in the text. The code runs but throws a 'List Index out of range' error part way through iterating over the items in the…

its_broke_again
- 319
- 4
- 12
0
votes
0 answers
Receiving incoming mail content with imapclient
I am using ImapClient. I cannot read the content of the incoming message.
How can I read the message content, time and who it came from?
from imapclient import IMAPClient
import email
HOST = 'imap.gmail.com'
USERNAME = 'username'
PASSWORD =…

fatih
- 1
0
votes
1 answer
issue connecting to IMAP server
I am trying to connect to my outlook email using
import imapclient
server = imapclient.IMAPClient('imap-mail.outlook.com', ssl=True)
server.login('myemail',password) …

currenseeds
- 1
- 1
- 1
0
votes
0 answers
How do I return MimeKit.MimeMessage in asp.net core web api? It is working fine in controller but not in Web Api
I am using ImapClient for retrieving emails from gmail or outlook or something. All is working in Controller but not working in Web api. May be there is error on Json conversion. Anyone help me on it please? Look this error message(Tested from…

Noor All Safaet
- 438
- 6
- 19
0
votes
0 answers
imapclient.IMAPClient [Seen] Flag in Python
I am processing emails using imapclient.IMAPClient in Python and want to flag the successfully processed emails as "Seen" at the end. I have tried different ways but they either do not flag all the successful email or do not show as "read" in my…

Taraneh_Kordi
- 3
- 2
0
votes
1 answer
Python reading email from outlook account using imaplib/imapclient vs exchangelib?
I am setting up a script to read incoming emails from an outlook.com account and I've tested a few approaches with imaplib and was unsuccessful. Yet when I tried with Exchangelib I was able to do this. I'm not entirely sure why Exchangelib works and…

alex
- 1,905
- 26
- 51
0
votes
2 answers
Getting the right 'Date' of the Last Email Sent to the Contact
So I am successful in getting the date for the last email received from the contact in the code below.
Now I am trying to get the date for the last email sent to the contact. As a beginner to the coding/python, I am not able to get it right. I…

Sourav Chatterjee
- 81
- 11
0
votes
0 answers
Expand Date Range for search Gmail using Imapclient
So my goal is to find the last email from a contact and enter into a sheet. The current challenge is related to the Gmail part.
So the current code is giving me the desired result. However, some contacts has more than 1000's of email and listing…

Sourav Chatterjee
- 81
- 11
0
votes
1 answer
Get only information of the last mail of the contact from Imapclient
So I am a beginner in Python and coding and trying to build up a code that will give information about the last email received from a contact. Right now what I have gives the output of all the email received from the contact. I just want it to print…

Sourav Chatterjee
- 81
- 11