Hendrik Lipka / pop3

Dependents:   mmain pop3demo

Embed: (wiki syntax)

« Back to documentation index

Pop3 Class Reference

Pop3 Class Reference

Handling all POP3 related aspects. More...

#include <pop3.h>

Public Member Functions

 Pop3 (const char *servername, const char *username, const char *password)
 Creates the POP3 handler.
 ~Pop3 ()
 closes the connection, and cleans up resources
list< string > * getMessages ()
 Retrieve a list of all message IDs.
Pop3MessagegetMessage (string id, bool getSig=false, bool deleteOnReceive=false)
 retrieves as single message
bool deleteMessage (string id)
bool init ()
 Connects to the server.
void close ()
 closes the connection, and cleans up resources

Detailed Description

Handling all POP3 related aspects.

All operations are synchronous. This class expects a set-up network connection.

Needed libraries: DNSResolver NetServices (for TCP socket), or NetServicesMin

Definition at line 68 of file pop3.h.


Constructor & Destructor Documentation

Pop3 ( const char *  servername,
const char *  username,
const char *  password 
)

Creates the POP3 handler.

Parameters:
servernamethe DNS name of the server
usernamethe username
passwordthe users password

Definition at line 42 of file pop3.cpp.

~Pop3 (  )

closes the connection, and cleans up resources

Definition at line 48 of file pop3.cpp.


Member Function Documentation

void close (  )

closes the connection, and cleans up resources

Definition at line 201 of file pop3.cpp.

bool deleteMessage ( string  id )
Parameters:
idthe ID of the message to be deleted
Returns:
true if the deletion was sucessful

Definition at line 122 of file pop3.cpp.

Pop3Message * getMessage ( string  id,
bool  getSig = false,
bool  deleteOnReceive = false 
)

retrieves as single message

Parameters:
idthe message ID to retrieve
getSigwhen false, the signature will be stripped (separated by the line '-- ')
deleteOnReceivewhen true the message will be deleted after a sucessful retrieval
Returns:
the message container

Definition at line 70 of file pop3.cpp.

list< string > * getMessages (  )

Retrieve a list of all message IDs.

This method doesn't care whether the messages have been read already or not. The IDs are not sorted, but returned in the order the server delivers them.

Returns:
the list of all message IDs stored at the server.

Definition at line 52 of file pop3.cpp.

bool init (  )

Connects to the server.

Needs the ethernet connection already set up.

Returns:
true if the connection has been made (and the user logged in)

Definition at line 161 of file pop3.cpp.