No description
Find a file
Federico Ceratto 8abeeaf6b2 Switch README
2019-03-10 11:17:01 +00:00
.gitignore Initial commit 2015-08-25 22:47:10 +01:00
LICENSE Initial commit 2015-08-25 22:47:10 +01:00
pop3.nim Add type 2017-11-01 23:39:20 +00:00
pop3.nimble Update nimble file, v 0.1.1 2019-03-10 11:13:36 +00:00
README.adoc Switch README 2019-03-10 11:17:01 +00:00

=== 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()
----