sptk2 logo
SPTK Home Page

sptk::CBaseMailConnect Class Reference
[Utility Classes]

Base mail socket. More...

#include <CBaseMailConnect.h>

Inheritance diagram for sptk::CBaseMailConnect:

sptk::CSmtpConnect

List of all members.

Public Member Functions

 CBaseMailConnect ()
 Default constructor.
virtual ~CBaseMailConnect ()
 Default destructor.
std::string from () const
void from (std::string addr)
std::string to () const
void to (std::string addr)
std::string cc () const
void cc (std::string addr)
std::string bcc () const
void bcc (std::string addr)
std::string subject () const
void subject (std::string subj)
std::string body () const
void body (const std::string &body, bool smtp)
 Sets the current plain text part of e-mail message.
std::string attachments () const
void attachments (std::string attachments)
const CBuffermessageBuffer () const
void mimeMessage (CBuffer &buffer)
virtual void sendMessage ()=0

Protected Member Functions

void mimeFile (std::string fileName, std::string fileAlias, std::stringstream &message)
 Encoding the message into internal message buffer.

Protected Attributes

std::string m_from
 Mail FROM: a single e-mail address in format: "Jonh Doe <jonhd@noname.com>".
std::string m_to
 Mail TO: semicolon-separated string of addresses in format: "Jonh Doe <jonhd@noname.com>; Jane Doe <janed@noname.com>".
std::string m_cc
 Mail CC: semicolon-separated string of addresses in format: "Jonh Doe <jonhd@noname.com>; Jane Doe <janed@noname.com>".
std::string m_bcc
 Mail BCC: semicolon-separated string of addresses in format: "Jonh Doe <jonhd@noname.com>; Jane Doe <janed@noname.com>".
std::string m_subject
 Mail SUBJECT:.
CMailMessageBody m_body
 Mail text (plain-text and html parts of the message).
std::string m_attachments
 The list of attachment files separated with ';'.
CBuffer m_messageBuffer
 Internal message buffer.


Detailed Description

Base mail socket.

CBaseMailConnect class is the base class for mail message components


Member Function Documentation

void sptk::CBaseMailConnect::attachments ( std::string  attachments  )  [inline]

Method attachments() sets the current semicolon-separated list of attachments of e-mail message. Example: "readme.txt;readme.doc".

Parameters:
attachments current message list of attachments

References m_attachments.

std::string sptk::CBaseMailConnect::attachments (  )  const [inline]

Method attachments() returns the current semicolon-separated list of attachments of e-mail message. Example: "readme.txt;readme.doc".

Returns:
current message list of attachments

References m_attachments.

void sptk::CBaseMailConnect::bcc ( std::string  addr  )  [inline]

Method bcc() sets the current value of 'BCC:' field of e-mail message.

Parameters:
addr should be a semicolon-separated list of one or more e-mail addresses in format: Real sender name <sender@host.net>. The example: John Doe <johnd@unknown.org>

References m_bcc.

std::string sptk::CBaseMailConnect::bcc (  )  const [inline]

Method bcc() returns the current value of 'BCC:' field of e-mail message.

Returns:
a list of e-mail addresses. See method to() description for format

References m_bcc.

void sptk::CBaseMailConnect::body ( const std::string &  body,
bool  smtp 
) [inline]

Sets the current plain text part of e-mail message.

Parameters:
body std::string&, message body
smtp bool, do we need special pre-processing for SMTP?

References m_body, and sptk::CMailMessageBody::text().

std::string sptk::CBaseMailConnect::body (  )  const [inline]

Method subject() returns the current plain text part of e-mail message.

Returns:
current message plain-text part

References m_body, and sptk::CMailMessageBody::text().

void sptk::CBaseMailConnect::cc ( std::string  addr  )  [inline]

Method cc() sets the current value of 'CC:' field of e-mail message.

Parameters:
addr should be a semicolon-separated list of one or more e-mail addresses in format: Real sender name <sender@host.net>. The example: John Doe <johnd@unknown.org>

References m_cc.

std::string sptk::CBaseMailConnect::cc (  )  const [inline]

Method cc() returns the current value of 'CC:' field of e-mail message

Returns:
a list of e-mail addresses. See method to() description for format

References m_cc.

void sptk::CBaseMailConnect::from ( std::string  addr  )  [inline]

Method from() sets the current value of 'FROM:' field of e-mail message.

Parameters:
addr should be an e-mail address in format: Real sender name <sender@host.net>. The example: John Doe <johnd@unknown.org>

References m_from.

std::string sptk::CBaseMailConnect::from (  )  const [inline]

Method from() returns the current value of 'FROM:' field of e-mail message.

Returns:
a single e-mail address.

References m_from.

const CBuffer& sptk::CBaseMailConnect::messageBuffer (  )  const [inline]

Method messageBuffer() returns the reference to the internal current message text completely prepared for sending, as described in RFC-822 message format. It only makes sense to use it after call to sendMessage().

Returns:
reference to current message text

References m_messageBuffer.

void sptk::CBaseMailConnect::mimeMessage ( CBuffer buffer  ) 

Method mimeMessage() encodes the message components into RFC-822 message format.

Parameters:
buffer A buffer to put the encoded RFC-822 format message

virtual void sptk::CBaseMailConnect::sendMessage (  )  [pure virtual]

Method sendMessage() builds an RFC-822 format message out of message parameters, and sends it. Should be implemented in derived classes.

Implemented in sptk::CSmtpConnect.

void sptk::CBaseMailConnect::subject ( std::string  subj  )  [inline]

Method subject() sets the current value of 'BCC:' field of e-mail message.

Parameters:
subj A message subject

References m_subject.

std::string sptk::CBaseMailConnect::subject (  )  const [inline]

Method subject() returns the current value of 'SUBJECT:' field of e-mail message.

Returns:
current message subject

References m_subject.

void sptk::CBaseMailConnect::to ( std::string  addr  )  [inline]

Method from() sets the current value of 'TO:' field of e-mail message.

Parameters:
addr should be a semicolon-separated list of one or more e-mail addresses in format: Real sender name <sender@host.net>. The example: John Doe <johnd@unknown.org>

References m_to.

std::string sptk::CBaseMailConnect::to (  )  const [inline]

Method to() returns the current value of 'TO:' field of e-mail message

References m_to.


The documentation for this class was generated from the following file:

Mon Mar 5 11:55:56 2012: SPTK 3.5.7