(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/lib/pop3-objects.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/lib/module-poplib.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/lib/module-imaplib.html| ]]
|
Python Library Reference
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/lib/contents.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/lib/modindex.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/lib/genindex.html| ]]
|
Previous: 11.7.1 POP3 Objects Up: 11.7 poplib Next: 11.8 imaplib
11.7.2 POP3 Example
Here is a minimal example (without error checking) that opens a mailbox and retrieves and prints all messages:
import getpass, poplib
M = poplib.POP3('localhost')
M.user(getpass.getuser())
M.pass_(getpass.getpass())
numMessages = len(M.list()[1])
for i in range(numMessages):
for j in M.retr(i+1)[1]:
print j
At the end of the module, there is a test section that contains a more extensive example of usage.
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/lib/pop3-objects.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/lib/module-poplib.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/lib/module-imaplib.html| ]]
|
Python Library Reference
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/lib/contents.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/lib/modindex.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/lib/genindex.html| ]]
|
Previous: 11.7.1 POP3 Objects Up: 11.7 poplib Next: 11.8 imaplib
See About this document... for information on suggesting changes.