Questions tagged [poplib]

A python class which encapsulates a connection to a POP3/POP3_SSL server and implements protocol as defined in RFC 1725.

This python module defines a class, POP3, which encapsulates a connection to a POP3 server and implements the protocol as defined in RFC 1725. The POP3 class supports both the minimal and optional command sets. Additionally, this module provides a class POP3_SSL, which provides support for connecting to POP3 servers that use SSL as an underlying protocol layer.

62 questions
2
votes
1 answer

poplib mark as seen

I am using poplib in Python 3.3 to fetch emails from a gmail account and everything is working well, except that the mails are not marked as read after retrieving them with the retr() method, despite the fact that the documentation says "Retrieve…
2
votes
1 answer

How to save an e-mail message to a file without loading into memory?

How to save an e-mail message to a file without loading into memory? I use import poplib pop_conn = poplib.POP3(servername) pop_conn.user(username) pop_conn.pass_(passwd) msg = pop_conn.retr(msg_number)[1] msg_text = '\n'.join(msg) msg_file =…
agrynchuk
  • 4,597
  • 3
  • 17
  • 17
1
vote
1 answer

Aide with error when trying to get email poplib

This what ive tried so far : # view and delete e-mail using the POP3 protocol import sys, getpass, poplib, re # change according to your needs POPHOST = "pop3.126.com" POPUSER = "Username" POPPASS = "pass" # the number of message body lines to…
P'sao
  • 2,946
  • 11
  • 39
  • 48
1
vote
2 answers

If I give a POP server invalid credentials using poplib, why can't I try again with the correct ones?

I'm writing a script to login to Hotmail. It asks the user to enter a password and if they get the password right, all is well. If they get the password wrong the first time however, the valid password will not work on subsequent attempts. This is…
Dean
  • 8,632
  • 6
  • 45
  • 61
1
vote
0 answers

Problem using Python's poplib to check email

When I use Python's poplib stat() method to check how many emails there are, it returns 0 even though there are emails in the server. Does anyone know why this happens? I can connect to the server with my email address and password, but I can't see…
Davies Dan
  • 11
  • 1
1
vote
4 answers

Poplib not working correctly?

I want to get all the messages from my gmail inbox, but I am facing 2 problems. It does not get all the emails, (as per the count in stat function) The order of emails it get is random. I am unsure if its the problem with poplib or gmail pop…
Mohit Ranka
  • 4,193
  • 12
  • 41
  • 41
1
vote
1 answer

Connection Refused Error When Trying to Connect to Outlook Using Python's poplib

I am trying to connect to Outlook using POP3 in python. mailbox = poplib.POP3_SSL('outlook.office365.com', 995) And I am getting the following error: [WinError 10061] No connection could be made because the target machine actively refused it I am…
marifkind
  • 115
  • 11
1
vote
0 answers

How to connect pop3 server via http proxy?

I am using poplib to receive email but my computer accesses internet via http proxy. It seems that poplib does not support proxy? How to use poplib using http proxy? Many thanks!
Treper
  • 3,539
  • 2
  • 26
  • 48
1
vote
1 answer

Problem with deleting emails using poplib

I have written a program to read outlook emails using poplib and outputting only the filtered data into json and then deleting all the emails. But with the code I wrote It's not deleting all the emails and deleting only one email. Can anybody help…
MSR
  • 63
  • 7
1
vote
0 answers

extract email text body without html content in python poplib

I need help. This is the email i want to retrieve. Its just a plain text. But when I retrieve it the html content is being retrieved as well. This is the example: What do i need to do to only retrieve the message inside the yellow box? My…
lu_laude
  • 91
  • 1
  • 9
1
vote
1 answer

Python poplib: retrieving body of the email result to NONE

I can get the subject of the email however the body always result to NONE. Tried following this link but all the suggestions end up the same. The body still prints as NONE. import poplib from email import parser pop_conn =…
lu_laude
  • 91
  • 1
  • 9
1
vote
0 answers

Writing email reply bot using poplib and random emails keep showing up in me re.findall(...) call

I'm using poplib to connect to a gmail account and I want it to reply to emails that are sent to it. However sometimes my regular expression's statement grabs random emails that aren't the one I wanted to reply to. For example:…
hkurtis
  • 11
  • 4
1
vote
0 answers

Python: Connecting to gmail server using poplib giving error

I am trying to connect to gmail server using POP protocol using poplib library. it fails to connect with error:socket.gaierror: [Errno -2] Name or service not known I have network access from the machine i am running my script. import…
Pradeep
  • 1,057
  • 2
  • 9
  • 17
1
vote
1 answer

Checking new mails of Gmail account through python

I'm using this code to check for new mails with a 10 seconds delay. import poplib from email import parser import time def seeit(): pop_conn = poplib.POP3_SSL('pop.gmail.com') pop_conn.user('xxx') pop_conn.pass_('xx') #Get messages…
1
vote
2 answers

commands to send messages in Python via the Poplib module?

I've found a number of tutorials online involving downloading messages via Poplib, but haven't been able to find anything explaining how to create new messages. Does this exist?
Al