Questions tagged [imaplib]

Python module to provide an Internet Message Access Protocol (IMAP) client implementation. This protocol lets you access mail folders stored on a central mail server, as if they were local.

Python module to provide an Internet Message Access Protocol (IMAP) client implementation. This protocol lets you access mail folders stored on a central mail server, as if they were local.

694 questions
0
votes
1 answer

Show mail sent through SMTP server in my IMAP "Sent" mailbox

I am able to send a mail using a SMTP server: self.smtp_connection.sendmail( 'my_smtp_username@provider.com', recipients, # list of To, Cc and Bcc mails mime_message.as_string() ) But I can't see the mail sent in the "Sent" box in the…
Maxime Lorant
  • 34,607
  • 19
  • 87
  • 97
0
votes
1 answer

python3 - imaplib: randomly(?) can' fetch received email

def get_email_body(self, email): user = self.email_usr password = self.app_email_pwd connection = imaplib.IMAP4_SSL('imap.gmail.com') connection.login(user, password) connection.list() connection.select('"INBOX"') …
Vladimir Kolenov
  • 438
  • 1
  • 4
  • 14
0
votes
0 answers

Is it possible to search multiple criteria's in imaplib

I succesfully created a script that searches mail from a specific sender (FROM) and perform actions with it. The only problem I have atm is that it loops through all mail from that sender. (it's an automatic mail that sends every hour), so after a…
JC97
  • 1,530
  • 2
  • 23
  • 44
0
votes
2 answers

About IMAP UID with imaplib

I try to move email from mailbox's gmail to another one, Just curious that UID of each email will change when move to new mailbox ?
vernomcrp
  • 3,459
  • 11
  • 34
  • 44
0
votes
1 answer

Python: email.message_from_string performance with large data in email body

I've been playing around with Python's imaplib and email module recently. I tried sending and receiving large emails (with most of the data in the body of the email rather than attachments) using the imaplib/email modules. However, I've noticed a…
0
votes
0 answers

Python imap search only by part of body?

I am using imaplib module to connect to outlook account which used for webdriver tests (our application sends emails). Letter contains screenshot and some text. I am searching inbox following way: self._imap.search(None, 'UNDELETED', 'UNSEEN',…
Alex G.P.
  • 9,609
  • 6
  • 46
  • 81
0
votes
1 answer

How to I filter out emails from multiple senders on a given date using imaplib in Python?

I am using the imaplib4 search function as of now and calling it multiple times for each email id. I tried looking everywhere on the internet to look for a format that would let me specify email ids in OR and a date. As of now this format is working…
Amogh Talpallikar
  • 12,084
  • 13
  • 79
  • 135
0
votes
0 answers

imaplib reads not latest e-mail

I have a mailbox and I need to read incoming mails from python. The mail server supports IMAP access so, I'm trying to use python build-in module imaplib. My code: import imaplib def ReadLatest(): m = imaplib.IMAP4_SSL() …
Jury
  • 1,227
  • 3
  • 17
  • 30
0
votes
1 answer

What is the \ used for in python?

I'm following along with a tutorial for imaplib and it uses a . I can't find any information about it anywhere. stat, dta = msrvr.fetch\ (cnt[0],\ '(UID BODY[TEXT])')
user5460786
0
votes
1 answer

Extract Full Email header using imaplib in Python

I am trying to extract the entire email header using imaplib in Python. At the momment I am using the line below which provides subject, From, To and Date etc but seems to be missing a lot of data compared to when I view the original message in…
user5298729
  • 105
  • 1
  • 2
  • 6
0
votes
1 answer

Python imaplib select mailbox folder including special characters

If I list my mailbox folder with conn.list() I get a list of mailbox folder names that do not include special (accented) characters. E.g. my real mailbox fodler is "gelöschte elemente" but conn.list() returns with "gelschte elemente". It would not…
ragesz
  • 9,009
  • 20
  • 71
  • 88
0
votes
2 answers

IMAP: from UID of message to folder name?

I am connecting to a IMAP server with Python. I have a UID of a special message. Is there a way to get the folder name which contains this UID? Or can a UID/message be in more than one folder? Then, I would like to get the list of folders this…
guettli
  • 25,042
  • 81
  • 346
  • 663
0
votes
1 answer

Connection actively refused when trying to connect to emails on localhost

I am using imaplib to read emails on my localhost through a python script. To do this I am using Xampp and MercuryMail. import imaplib import email #takes args for subject to check for def get_subject(subject): #most recent 15 emails for i…
Zachary Burke
  • 125
  • 1
  • 1
  • 6
0
votes
1 answer

Python gmail read new message from specific

I need read my gmail email, but I do not know how to read the contents of the message body, I hope you can help me, thank you very much! It is also helpful if I collaborate with the while loop. import imaplib print "Bienvenido" print "Logueando…
jcrashvzla
  • 57
  • 2
  • 8
0
votes
0 answers

I have a python string that I need to assign each line to a variable

import imaplib import email m = imaplib.IMAP4_SSL("imap.gmail.com") m.login('*******', '*******') m.select('[Gmail]/All Mail') resp, items = m.search(None, 'ALL') items = items[0].split() for emailid in items: resp, data =…
Codezilla
  • 95
  • 1
  • 7