#include <mail.h>
Inheritance diagram for PMail:
User look up functions | |
enum | LookUpResult { UnknownUser, AmbiguousUser, ValidUser, LookUpError } |
Result of a lookup operation with the LookUp()# function. More... | |
LookUpResult | LookUp (const PString &name, PString *fullName=NULL) |
Public Member Functions | |
Log in/out functions | |
PBoolean | LogOn (const PString &username, const PString &password) |
PBoolean | LogOn (const PString &username, const PString &password, const PString &service) |
virtual PBoolean | LogOff () |
PBoolean | IsLoggedOn () const |
Send message functions | |
PBoolean | SendNote (const PString &recipient, const PString &subject, const char *body) |
PBoolean | SendNote (const PString &recipient, const PString &subject, const char *body, const PStringList &attachments) |
PBoolean | SendNote (const PString &recipient, const PStringList &carbonCopies, const PStringList &blindCarbons, const PString &subject, const char *body, const PStringList &attachments) |
Read message functions | |
PStringArray | GetMessageIDs (PBoolean unreadOnly=PTrue) |
PBoolean | GetMessageHeader (const PString &id, Header &hdrInfo) |
PBoolean | GetMessageBody (const PString &id, PString &body, PBoolean markAsRead=PFalse) |
PBoolean | GetMessageAttachments (const PString &id, PStringArray &filenames, PBoolean includeBody=PFalse, PBoolean markAsRead=PFalse) |
PBoolean | MarkMessageRead (const PString &id) |
PBoolean | DeleteMessage (const PString &id) |
Error functions | |
int | GetErrorCode () const |
PString | GetErrorText () const |
Protected Member Functions | |
void | Construct () |
Protected Attributes | |
PBoolean | loggedOn |
Flag indicating the session is active. | |
Classes | |
struct | Header |
Message header for each mail item. More... |
enum PMail::LookUpResult |
Result of a lookup operation with the LookUp()# function.
PMail::PMail | ( | ) |
Create a mail session. It is initially not logged in.
Create a mail session. Attempt to log in using the parameters provided.
username | User withing mail system to use. |
password | Password for user in mail system. |
Create a mail session. Attempt to log in using the parameters provided.
username | User withing mail system to use. |
password | Password for user in mail system. |
service | A platform dependent string indicating the location of the underlying messaging service, eg the path to a message store or node name of the mail server. |
virtual PMail::~PMail | ( | ) | [virtual] |
PMail::PMail | ( | ) |
Create a mail session. It is initially not logged in.
Create a mail session. Attempt to log in using the parameters provided.
username | User withing mail system to use. |
password | Password for user in mail system. |
Create a mail session. Attempt to log in using the parameters provided.
username | User withing mail system to use. |
password | Password for user in mail system. |
service | A platform dependent string indicating the location of the underlying messaging service, eg the path to a message store or node name of the mail server. |
virtual PMail::~PMail | ( | ) | [virtual] |
Attempt to log on to the mail system using the parameters provided.
username | User withing mail system to use. |
password | Password for user in mail system. |
PBoolean PMail::LogOn | ( | const PString & | username, | |
const PString & | password, | |||
const PString & | service | |||
) |
Attempt to log on to the mail system using the parameters provided.
username | User withing mail system to use. |
password | Password for user in mail system. |
service | A platform dependent string indicating the location of the underlying messaging service, eg the path to a message store or node name of the mail server. |
virtual PBoolean PMail::LogOff | ( | ) | [virtual] |
Log off from the mail system.
PBoolean PMail::IsLoggedOn | ( | ) | const |
Determine if the mail session is active and logged into the mail system.
Send a new simple mail message.
recipient | Name of recipient of the mail message. |
subject | Subject name for the mail message. |
body | Text body of the mail message. |
PBoolean PMail::SendNote | ( | const PString & | recipient, | |
const PString & | subject, | |||
const char * | body, | |||
const PStringList & | attachments | |||
) |
Send a new simple mail message.
recipient | Name of recipient of the mail message. |
subject | Subject name for the mail message. |
body | Text body of the mail message. |
attachments | List of files to attach to the mail message. |
PBoolean PMail::SendNote | ( | const PString & | recipient, | |
const PStringList & | carbonCopies, | |||
const PStringList & | blindCarbons, | |||
const PString & | subject, | |||
const char * | body, | |||
const PStringList & | attachments | |||
) |
Send a new simple mail message.
recipient | Name of recipient of the mail message. |
carbonCopies | Name of CC recipients. |
blindCarbons | Name of BCC recipients. |
subject | Subject name for the mail message. |
body | Text body of the mail message. |
attachments | List of files to attach to the mail message. |
PStringArray PMail::GetMessageIDs | ( | PBoolean | unreadOnly = PTrue |
) |
Get a list of ID strings for all messages in the mail box.
unreadOnly | Only get the IDs for unread messages. |
Get the header information for a message.
id | Identifier of message to get header. |
hdrInfo | Header info for the message. |
Get the body text for a message into the body# string parameter.
Note that if the body text for the mail message is very large, the function will return PFalse. To tell between an error getting the message body and having a large message body the GetErrorCode()# function must be used.
To get a large message body, the GetMessageAttachments()# should be used with the includeBody# parameter set to PTrue so that the message body is placed into a disk file.
id | Identifier of message to get body. |
body | Body text of mail message. |
markAsRead | Mark the message as read. |
PBoolean PMail::GetMessageAttachments | ( | const PString & | id, | |
PStringArray & | filenames, | |||
PBoolean | includeBody = PFalse , |
|||
PBoolean | markAsRead = PFalse | |||
) |
Get all of the attachments for a message as disk files.
id | Identifier of message to get attachments. |
filenames | File names for each attachment. |
includeBody | Include the message body as first attachment |
markAsRead | Mark the message as read |
Mark the message as read.
id | Identifier of message to get header. |
Delete the message from the system.
id | Identifier of message to get header. |
LookUpResult PMail::LookUp | ( | const PString & | name, | |
PString * | fullName = NULL | |||
) |
Look up the specified name and verify that they are a valid address in the mail system.
name | Name to look up. |
fullName | String to receive full name of user passed in name#. If NULL then the full name is { not} returned. |
int PMail::GetErrorCode | ( | ) | const |
Get the internal error code for the last error by a function in this mail session.
PString PMail::GetErrorText | ( | ) | const |
Get the internal error description for the last error by a function in this mail session.
void PMail::Construct | ( | ) | [protected] |
PBoolean PMail::loggedOn [protected] |
Flag indicating the session is active.