Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_MailMessage Class Reference

A CP_InternetMessage class used to manage messages sent and received by POP3 and SMTP protocols.

Inheritance diagram for CP_MailMessage:

CP_InternetMessage List of all members.

Public Member Functions

Getters
CP_String GetBody () const
CP_String GetHeader () const
Header
virtual void AddHeaderField (const CP_String &inHeaderTag, const CP_String &inHeaderBody, const CP_String &inHeaderLineTermination=CP_CRLF)
Setters
void SetBody (const CP_String &inBody)
void SetHeader (const CP_String &inHeader)
void SetIsIncomingMessage (bool inIsIncoming)
void SetIsHeaderFormatted (bool inIsFormatted)
Testers
bool IsIncomingMessage ()
bool IsHeaderFormatted ()
Constructor / Destructor
 CP_MailMessage ()
 Constructor.
 ~CP_MailMessage () throw ()
 Destructor.
Attachments
bool HaveAttachments ()
void AddAttachment (CP_MailAttachment *inAttachment)
void RemoveAttachment (CP_MailAttachment *inAttachment)
void RemoveAttachmentAt (UInt16 inItemIndex)
void RemoveAllAttachments ()
UInt32 GetNumberAttachments ()
CP_MailAttachment_ArrayGetAttachmentsList ()
CP_MailAttachmentGetNthAttachment (UInt32 inItemIndex)
Getters
CP_String GetHeaderItem (const CP_String &inName)
CP_String GetTo () const
CP_String GetSubject () const
CP_String GetFrom () const
CP_String GetDate () const
SInt32 GetGMTOffset ()
CP_Strings_ArrayGetSendToList ()
CP_Strings_ArrayGetCCList ()
CP_Strings_ArrayGetBccList ()
CP_String GetXMailerVers ()
Header
virtual void FormatHeader ()
MIME - Getters
virtual CP_String GetMIMEVers ()
virtual CP_String GetContentType ()
virtual CP_String GetBoundary ()
CP_String GetBoundaryHeader ()
CP_String GetBoundaryTerminator ()
MIME - Setters
void SetMIMEVers (const CP_String &inMIMEVers)
void SetContentType (const CP_String &inContentType)
void SetBoundary (const CP_String &inBoundary)
Recipients
bool HaveToList ()
bool HaveCCRecipients ()
bool HaveBccRecipients ()
void AddToRecipient (const CP_String &inRecipient)
void AddCCRecipient (const CP_String &inRecipient)
void AddBCCRecipient (const CP_String &inRecipient)
Setters
void SetTo (const CP_String &inTo)
void SetSubject (const CP_String &inSubject)
void SetFrom (const CP_String &inFrom)
void SetDate (const CP_String &inDate)
void SetXMailerVers (const CP_String &inMailerVers)
Getters
CP_String GetBody () const
CP_String GetHeader () const
Header
virtual void AddHeaderField (const CP_String &inHeaderTag, const CP_String &inHeaderBody, const CP_String &inHeaderLineTermination=CP_CRLF)
Setters
void SetBody (const CP_String &inBody)
void SetHeader (const CP_String &inHeader)
void SetIsIncomingMessage (bool inIsIncoming)
void SetIsHeaderFormatted (bool inIsFormatted)
Testers
bool IsIncomingMessage ()
bool IsHeaderFormatted ()

Protected Member Functions

Date
virtual CP_String FormatDate ()
CP_String GetToRecipientsForHeader ()
CP_String GetCCRecipientsForHeader ()

Protected Attributes

CP_String fTo
CP_String fSubject
CP_String fFrom
CP_String fDate
CP_String fReplyTo
CP_String fXMailerVers
CP_Strings_ArrayfSendToList
CP_Strings_ArrayfCCList
CP_Strings_ArrayfBCCList
CP_MailAttachment_ArrayfAttachments
CP_String fContentType
CP_String fBoundary
CP_String fMIMEVers
CP_String fBody
CP_String fHeader
bool fIsIncomingMessage
bool fHeaderIsFormatted

Private Member Functions

Initialization
void Init ()

Constructor & Destructor Documentation

CP_MailMessage::CP_MailMessage  ) 
 

Constructor.

Exceptions:
none 

CP_MailMessage::~CP_MailMessage  )  throw ()
 

Destructor.

Exceptions:
none 


Member Function Documentation

bool CP_MailMessage::HaveAttachments  ) 
 

Returns true if we have attachments for this message.

Exceptions:
none 
Returns:
bool True if there are attachments.

void CP_MailMessage::AddAttachment CP_MailAttachment inAttachment  ) 
 

Adds the passed in attachment object as an attachment to this message.

Parameters:
inAttachment The attachment to add to this message.
Exceptions:
none 
Returns:
void

void CP_MailMessage::RemoveAttachment CP_MailAttachment inAttachment  ) 
 

Removes the passed in attachment object from this message.

Parameters:
inAttachment The attachment to remove from this message.
Exceptions:
none 
Returns:
void

void CP_MailMessage::RemoveAttachmentAt UInt16  inItemIndex  ) 
 

Removes the attachment at the 1 based index.

Parameters:
inItemIndex Index of the attachment to remove.
Exceptions:
none 
Returns:
void

void CP_MailMessage::RemoveAllAttachments  ) 
 

Removes all attachments from this message.

Exceptions:
none 
Returns:
void

UInt32 CP_MailMessage::GetNumberAttachments  ) 
 

Returns the number of attachments to this message.

Exceptions:
none 
Returns:
UInt32 The number of attachments to this message.

CP_MailAttachment_Array* CP_MailMessage::GetAttachmentsList  ) 
 

Return the list of attachments for this message.

Exceptions:
none 
Returns:
CP_MailAttachment_Array List of attachments.

CP_MailAttachment * CP_MailMessage::GetNthAttachment UInt32  inItemIndex  ) 
 

Returns the nth attachment of this message.

Parameters:
inItemIndex Index of the attachment to return. This is a 1 based index.
Exceptions:
none 
Returns:
CP_MailAttachment * The attachment to retrieve.

CP_String CP_MailMessage::GetHeaderItem const CP_String inName  ) 
 

Returns a header item that matches the passed in name.

Parameters:
inName Name of the header item to return.
Exceptions:
none 
Returns:
CP_String The header item. if not found, an empty string is returned.

CP_String CP_MailMessage::GetTo  )  const
 

Return the To field for this message.

Exceptions:
none 
Returns:
CP_String const Text of the to field.

CP_String CP_MailMessage::GetSubject  )  const
 

Return the Subject field for this message.

Exceptions:
none 
Returns:
CP_String const Text of the subject field.

CP_String CP_MailMessage::GetFrom  )  const
 

Return the From field for this message.

Exceptions:
none 
Returns:
CP_String const Text of the from field.

CP_String CP_MailMessage::GetDate  )  const
 

Return the Date field for this message.

Exceptions:
none 
Returns:
CP_String const Text of the date field.

SInt32 CP_MailMessage::GetGMTOffset  ) 
 

Returns the GMT offset of our data / time in this message

Exceptions:
none 
Returns:
SInt32 The GMT offset.

CP_Strings_Array* CP_MailMessage::GetSendToList  ) 
 

Return the list of people this message is being sent to.

Exceptions:
none 
Returns:
CP_Strings_Array List of people the message is sent to.

CP_Strings_Array* CP_MailMessage::GetCCList  ) 
 

Return the list of people this message is being sent ccd to.

Exceptions:
none 
Returns:
CP_Strings_Array List of people the message is ccd to.

CP_Strings_Array* CP_MailMessage::GetBccList  ) 
 

Return the list of people this message is being bccd to.

Exceptions:
none 
Returns:
CP_Strings_Array List of people the message is bccd to.

CP_String CP_MailMessage::GetXMailerVers  ) 
 

Return a string that describes the version of the mailer program sending the message.

Exceptions:
none 
Returns:
CP_String XMailer version string.

void CP_MailMessage::FormatHeader  )  [virtual]
 

Formats the head for sending in this message.

Exceptions:
none 
Returns:
void

virtual CP_String CP_MailMessage::GetMIMEVers  )  [virtual]
 

Return the MIME version of this message.

Exceptions:
none 
Returns:
CP_String MIME version of message.

virtual CP_String CP_MailMessage::GetContentType  )  [virtual]
 

Return the MIME content type of this message.

Exceptions:
none 
Returns:
CP_String MIME content type of message.

virtual CP_String CP_MailMessage::GetBoundary  )  [virtual]
 

Return the boundry type between MIME sections of this message.

Exceptions:
none 
Returns:
CP_String Boundry type between MIME sections.

CP_String CP_MailMessage::GetBoundaryHeader  ) 
 

Returns the boundary header used to separate MIME sections.

Exceptions:
none 
Returns:
CP_String The boundary header.

CP_String CP_MailMessage::GetBoundaryTerminator  ) 
 

Returns the MIME boundary terminator.

Exceptions:
none 
Returns:
CP_String MIME boundary terminator.

void CP_MailMessage::SetMIMEVers const CP_String inMIMEVers  ) 
 

Sets the MIME version of this message.

Parameters:
inMIMEVers The MIME version of this message.
Exceptions:
none 
Returns:
void

void CP_MailMessage::SetContentType const CP_String inContentType  ) 
 

Sets the content type of this message.

Parameters:
inContentType The content type of this message.
Exceptions:
none 
Returns:
void

void CP_MailMessage::SetBoundary const CP_String inBoundary  ) 
 

Sets the boundry marker of this message.

Parameters:
inBoundary The boundary marker of this message.
Exceptions:
none 
Returns:
void

bool CP_MailMessage::HaveToList  ) 
 

Returns true if there are receipients in our To list.

Exceptions:
none 
Returns:
bool True if we have receipients for this message.

bool CP_MailMessage::HaveCCRecipients  ) 
 

Returns true if there are receipients in our CC list.

Exceptions:
none 
Returns:
bool True if we have cc receipients for this message.

bool CP_MailMessage::HaveBccRecipients  ) 
 

Returns true if there are receipients in our BCC list.

Exceptions:
none 
Returns:
bool True if we have BCC receipients for this message.

void CP_MailMessage::AddToRecipient const CP_String inRecipient  ) 
 

Adds a new receipient to our To receipients list.

Parameters:
inRecipient The recipient to add to the receipients list.
Exceptions:
none 
Returns:
void

void CP_MailMessage::AddCCRecipient const CP_String inRecipient  ) 
 

Adds a new receipient to our CC receipients list.

Parameters:
inRecipient The recipient to add to the cc list.
Exceptions:
none 
Returns:
void

void CP_MailMessage::AddBCCRecipient const CP_String inRecipient  ) 
 

Adds a new receipient to our BCC receipients list.

Parameters:
inRecipient The recipient to add to the BCC list.
Exceptions:
none 
Returns:
void

void CP_MailMessage::SetTo const CP_String inTo  ) 
 

Sets the To field of this message.

Parameters:
inTo Text of the To field.
Exceptions:
none 
Returns:
void

void CP_MailMessage::SetSubject const CP_String inSubject  ) 
 

Sets the Subject field of this message.

Parameters:
inSubject Text of the Subject field.
Exceptions:
none 
Returns:
void

void CP_MailMessage::SetFrom const CP_String inFrom  ) 
 

Sets the From field of this message.

Parameters:
inFrom Text of the From field.
Exceptions:
none 
Returns:
void

void CP_MailMessage::SetDate const CP_String inDate  ) 
 

Sets the Date field of this message.

Parameters:
inTo Text of the date field.
Exceptions:
none 
Returns:
void

void CP_MailMessage::SetXMailerVers const CP_String inMailerVers  ) 
 

Sets the XMailerVers field of this message.

Parameters:
inTo Text of the XMailerVers field.
Exceptions:
none 
Returns:
void

CP_String CP_MailMessage::FormatDate  )  [protected, virtual]
 

Format the date into the correct format for this message.

Exceptions:
none 
Returns:
CP_String The formatted date.

CP_String CP_MailMessage::GetToRecipientsForHeader  )  [protected]
 

Returns a string containing all of the to receipients for this message.

Exceptions:
none 
Returns:
CP_String List of the to receipients.

CP_String CP_MailMessage::GetCCRecipientsForHeader  )  [protected]
 

Returns a string containing all of the CC receipients for this message.

Exceptions:
none 
Returns:
CP_String List of the CC receipients.

void CP_MailMessage::Init  )  [private]
 

Initialize the various fields of this message to default values.

Exceptions:
none 
Returns:
void

Reimplemented from CP_InternetMessage.

CP_String CP_InternetMessage::GetBody  )  const [inherited]
 

Return the body section of the message.

Exceptions:
none 
Returns:
CP_String const The body of the message.

CP_String CP_InternetMessage::GetHeader  )  const [inherited]
 

Return the header section of the message.

Exceptions:
none 
Returns:
CP_String const The header of the message.

void CP_InternetMessage::AddHeaderField const CP_String inHeaderTag,
const CP_String inHeaderBody,
const CP_String inHeaderLineTermination = CP_CRLF
[virtual, inherited]
 

Adds a new member to the header.

Parameters:
inHeaderTag Tag for this item.
inHeaderBody Text of the header item.
inHeaderLineTermination Line termination for this item.
Exceptions:
none 
Returns:
void

void CP_InternetMessage::SetBody const CP_String inBody  )  [inherited]
 

Sets the body section of the message.

Parameters:
inBody The body of the message.
Exceptions:
none 
Returns:
void

void CP_InternetMessage::SetHeader const CP_String inHeader  )  [inherited]
 

Sets the header section of the message.

Parameters:
inHeader The header of the message.
Exceptions:
none 
Returns:
void

void CP_InternetMessage::SetIsIncomingMessage bool  inIsIncoming  )  [inherited]
 

Set the flag to indicate if this is a message we are receiving, or sending. If inIsIncoming is true, then this is a received message.

Parameters:
inIsIncoming Flag to indicate if incoming message.
Exceptions:
none 
Returns:
void

void CP_InternetMessage::SetIsHeaderFormatted bool  inIsFormatted  )  [inherited]
 

Set a flag to indicate if the header is formatted for sending.

Parameters:
inIsFormatted Flag to indicate if the message is formatted for sending.
Exceptions:
none 
Returns:
void

bool CP_InternetMessage::IsIncomingMessage  )  [inherited]
 

Returns the IsIncomingMessage flag.

Exceptions:
none 
Returns:
bool True if the message is incoming.

bool CP_InternetMessage::IsHeaderFormatted  )  [inherited]
 

Returns the flag to indicate if the message is formatted for sending.

Exceptions:
none 
Returns:
bool True if the message is formatted.


Member Data Documentation

CP_String CP_MailMessage::fTo [protected]
 

CP_String CP_MailMessage::fSubject [protected]
 

Who the message is being sent to.

CP_String CP_MailMessage::fFrom [protected]
 

Subject of the message.

CP_String CP_MailMessage::fDate [protected]
 

Who the message is from.

CP_String CP_MailMessage::fReplyTo [protected]
 

Date & time message was sent

CP_String CP_MailMessage::fXMailerVers [protected]
 

Reply to person.

CP_Strings_Array* CP_MailMessage::fSendToList [protected]
 

Defines which mailer sent the message.

CP_Strings_Array* CP_MailMessage::fCCList [protected]
 

List of people to send message to.

CP_Strings_Array* CP_MailMessage::fBCCList [protected]
 

List of people to cc message to.

CP_MailAttachment_Array* CP_MailMessage::fAttachments [protected]
 

List of people to bcc message to.

CP_String CP_MailMessage::fContentType [protected]
 

List of attachments for this message.

CP_String CP_MailMessage::fBoundary [protected]
 

Content type of message.

CP_String CP_MailMessage::fMIMEVers [protected]
 

Boundary between elements in message.

CP_String CP_InternetMessage::fBody [protected, inherited]
 

CP_String CP_InternetMessage::fHeader [protected, inherited]
 

The body of the message in a CP_String object.

bool CP_InternetMessage::fIsIncomingMessage [protected, inherited]
 

The header of the message in a CP_String object.

bool CP_InternetMessage::fHeaderIsFormatted [protected, inherited]
 

Flag to indicate if this is an incoming message.


The documentation for this class was generated from the following files:
Generated on Sat Sep 17 20:01:50 2005 for CPLAT by  doxygen 1.4.0