Qore Pop3Client Module Reference  1.4
Pop3Client Module

The Pop3Client module provides the Pop3Client class for retrieving emails from a POP3 server, with or without TLS/SSL encryption.

To use this module, use "%requires Pop3Client" in your code. See examples/pop3.q for an example program using this module.

All the public symbols in the module are defined in the Pop3Client namespace.

The main class is:

  • Pop3Client: provides an interface to a POP3 server for retrieving emails
Example:
1 #!/usr/bin/env qore -n
2 
3 %requires Pop3Client
4 
5 sub log(string msg) {
6  printf("%y: %s\n", now_ms(), vsprintf(msg, argv));
7 }
8 
9 string url = "pop3s://username:pass@pop.gmail.com";
10 Pop3Client pop3(url, \log(), \log());
11 # do not send a QUIT so changes will not be committed
12 pop3.noquit(True);
13 *hash h = pop3.getMail();
14 printf("Mailbox Summary:\n");
15 map printf("%s: From: %s (size: %d bytes, attachments: %d)\n", $1.key, $1.value.msg.getFrom(), $1.value.size, $1.getvalue.msg.getAttachments().size()), h.pairIterator();
16 if (!h)
17  printf("no messages\n");