MMSMail Class Reference

A smtp mail transfer class. More...

#include <mmsmail.h>

List of all members.


Public Member Functions

 MMSMail (const std::string _subject, const std::string _returnAddress, const std::string _host)
 Constructor of class MMSMail.
 ~MMSMail ()
 Destructor of class MMSMail.
std::string getSubject () const
 Returns the mail subject line.
void setSubject (const std::string subject)
 Sets the mail subject line.
std::string getReturnAddress () const
 Returns the mails return addresss.
void setReturnAddress (std::string returnAddress)
 Sets the mails return address.
std::string getRecipient (int index) const
 Returns the recipient at the given index.
const int getRecipientCount () const
 Returns the current number of recipients.
void addRecipient (std::string recipient)
 Adds a recipient to the current mail.
void removeRecipient (int index)
 Removes a recipient at the given index.
std::string getMailBody () const
 Returns the mails message text.
void setMailBody (std::string mailBody)
 Sets the mails message text.
std::string getHost () const
 Returns the current mail servers address.
void setHost (std::string host)
 Sets the mail servers address.
void setAuthData (const std::string &user, const std::string &password)
 Use this to set user and password for the smtp server connection, if necessary.
void send ()
 Sends the mail to the specified recipients.

Private Attributes

std::string subject
std::string returnAddress
std::vector< std::string > recipients
std::string mailBody
std::string host
vmime::ref< vmime::net::transport > transportService

Detailed Description

A smtp mail transfer class.

This class provides functions to to send e-mails via a smtp server. Secure connections are note supported.

Author:
Patrick Helterhoff

Definition at line 50 of file mmsmail.h.


Constructor & Destructor Documentation

MMSMail::MMSMail ( const std::string  _subject,
const std::string  _returnAddress,
const std::string  _host 
)

Constructor of class MMSMail.

Parameters:
_subject [in] the mail subject line
_returnAddress [in] the return address
_host [in] the smtp server name

Definition at line 35 of file mmsmail.cpp.

MMSMail::~MMSMail (  ) 

Destructor of class MMSMail.

Definition at line 41 of file mmsmail.cpp.


Member Function Documentation

std::string MMSMail::getSubject (  )  const

Returns the mail subject line.

Definition at line 45 of file mmsmail.cpp.

void MMSMail::setSubject ( const std::string  subject  ) 

Sets the mail subject line.

Parameters:
subject [in] the mail subject

Definition at line 49 of file mmsmail.cpp.

std::string MMSMail::getReturnAddress (  )  const

Returns the mails return addresss.

Definition at line 53 of file mmsmail.cpp.

void MMSMail::setReturnAddress ( std::string  returnAddress  ) 

Sets the mails return address.

Parameters:
returnAddress [in] the mails return address

Definition at line 57 of file mmsmail.cpp.

std::string MMSMail::getRecipient ( int  index  )  const

Returns the recipient at the given index.

Parameters:
index [in] index of the recipient (first element = 0)

Definition at line 61 of file mmsmail.cpp.

const int MMSMail::getRecipientCount (  )  const

Returns the current number of recipients.

Definition at line 68 of file mmsmail.cpp.

void MMSMail::addRecipient ( std::string  recipient  ) 

Adds a recipient to the current mail.

Definition at line 72 of file mmsmail.cpp.

void MMSMail::removeRecipient ( int  index  ) 

Removes a recipient at the given index.

Parameters:
index [in] index of the recipient (first element = 0)

Definition at line 76 of file mmsmail.cpp.

std::string MMSMail::getMailBody (  )  const

Returns the mails message text.

Definition at line 80 of file mmsmail.cpp.

void MMSMail::setMailBody ( std::string  mailBody  ) 

Sets the mails message text.

Parameters:
mailBody [in] Message text of the mail

Definition at line 84 of file mmsmail.cpp.

std::string MMSMail::getHost (  )  const

Returns the current mail servers address.

Definition at line 88 of file mmsmail.cpp.

void MMSMail::setHost ( std::string  host  ) 

Sets the mail servers address.

Parameters:
host [in] the mail servers address

Definition at line 92 of file mmsmail.cpp.

void MMSMail::setAuthData ( const std::string &  user,
const std::string &  password 
)

Use this to set user and password for the smtp server connection, if necessary.

Parameters:
user [in] the ftp user
password [in] the password

Definition at line 101 of file mmsmail.cpp.

void MMSMail::send (  ) 

Sends the mail to the specified recipients.

Exceptions:
MMSError if errors occure during the mail send.

Definition at line 107 of file mmsmail.cpp.


Member Data Documentation

std::string MMSMail::subject [private]

Definition at line 52 of file mmsmail.h.

std::string MMSMail::returnAddress [private]

Definition at line 53 of file mmsmail.h.

std::vector<std::string> MMSMail::recipients [private]

Definition at line 54 of file mmsmail.h.

std::string MMSMail::mailBody [private]

Definition at line 55 of file mmsmail.h.

std::string MMSMail::host [private]

Definition at line 56 of file mmsmail.h.

vmime::ref<vmime::net::transport> MMSMail::transportService [private]

Definition at line 57 of file mmsmail.h.


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