![]() |
Access Mails Through POP3 in Python
Post Office Protocal version 3 (POP3) is protocol of the TCP/IP stack's application layer, used to fetch email from remote mail servers. POP is one of the most used protocols for email retrieval, other one being IMAP. Virtually every email application, be it in the desktop or mobile supports the POP protocol. POP was succeeded by IMAP which has become the default protocol in many email clients.
POP is way simpler than IMAP, so it is better suited for programs which need to access mails & process them, say a notifier, or check for specific mails process & delete them. In this article we'll see how to access a mailbox via POP3 in Python. The Module And UsagePython comes with a module poplib for accessing POP3 servers. This module also supports the Secure Socket Layer (SSL), so you can be assured that no one is evaedropping on your message or password. In the following example we'll be looking at connecting to a remote POP3 server and fetching message summaries and a few messages for demonstration purposes, if you want to test the code yourself, please changes the server host, username & password values accordingly. Code: Python
That's about it, that's all you'd need to access mails over POP3 with Python. If you need to access GMail accounts, please make sure that POP is enabled for those GMail accounts. Referenceshttp://docs.python.org/library/poplib.html |
Re: Access Mails Through POP3 in Python
Perfect! I would like to see SMTP tutorail too :D If you don't mind, you could write it too :)
|
Re: Access Mails Through POP3 in Python
Quote:
|
| All times are GMT +5.5. The time now is 01:21. |