mirror of
https://github.com/FedericoCeratto/nim-pop3
synced 2026-01-03 00:04:47 +00:00
No description
| .gitignore | ||
| LICENSE | ||
| pop3.nim | ||
| pop3.nimble | ||
| README.adoc | ||
=== pop3
image:https://img.shields.io/github/tag/FedericoCeratto/nim-pop3.svg[tags]
image:https://img.shields.io/badge/License-LGPL%20v3-blue.svg[License]
Nim POP3 client library
==== Usage
[source,nim]
----
import pop3
import logging
import net # used for .Port
newConsoleLogger().addHandler()
let c = newPOP3Client(host="<pop_server_fqdn>")
c.user("<username>")
c.pass("<password>")
c.noop() # do nothing
# list messages
echo c.list()
# list one message
echo c.list(msg_num=1)
# fetch message
echo c.retr(msg_num=1).body
# list message IDs
echo c.list_uidl()
# fetch statistics
echo c.stat()
# fetch capabilities
let caps = c.capa()
c.rset()
c.quit()
----