SMTPConnection Class Reference

#include <SMTPConnection.h>

List of all members.

Public Types

enum  SMTPState

Public Member Functions

 SMTPConnection ()
 ~SMTPConnection ()
SMTPState getSMTPState ()
void setSMTPHost (string host)
void setSMTPPort (int port)
void setMyHostname (string myname)
int sendMail (string &from, string &to, string &msg)
void disconnect ()


Detailed Description

SMTPConnection-Class.

This class is inherited from the Thread-class. This means, you can initialize a SMTPConnection-object, setup your SMTPConnection, start threading and push a message to the SMTPConnection. While the SMTPConnection send the message in its thread, you can continue doing other stuff.

SMTPConnection speaks plain SMTP, no ESMTP.

Definition at line 46 of file SMTPConnection.h.


Member Enumeration Documentation

enum SMTPConnection::SMTPState

Definition of the possible states of an SMTP-connection.

Definition at line 61 of file SMTPConnection.h.


Constructor & Destructor Documentation

SMTPConnection::SMTPConnection (  ) 

Constructor.

Definition at line 28 of file SMTPConnection.cc.

SMTPConnection::~SMTPConnection (  ) 

Destructor.

Definition at line 62 of file SMTPConnection.cc.

References disconnect().

Here is the call graph for this function:


Member Function Documentation

SMTPConnection::SMTPState SMTPConnection::getSMTPState (  ) 

Gets the current state of the connection. Since this is an unthreaded class, this will either be "SMTPState::NOT_CONNECTED" or "SMTPState::CONNECTED".

Returns:
SMTPConnection::SMTPState

Definition at line 80 of file SMTPConnection.cc.

Referenced by ThreadedSMTPConnection::getSMTPState().

void SMTPConnection::setSMTPHost ( string  host  ) 

Sets the IP of the SMTP-host to connect to.

Parameters:
string host IP-address of SMTP-host.

Definition at line 485 of file SMTPConnection.cc.

Referenced by ThreadedSMTPConnection::setSMTPHost().

void SMTPConnection::setSMTPPort ( int  port  ) 

Sets the port-number of the SMTP-host to connect to.

Parameters:
int port Port-number on SMTP-host.

Definition at line 496 of file SMTPConnection.cc.

Referenced by ThreadedSMTPConnection::setSMTPPort().

void SMTPConnection::setMyHostname ( string  myname  ) 

Sets the hostname to send in the HELO-command of the SMTP-dialog.

Parameters:
string myname HELO-hostname.

Definition at line 817 of file SMTPConnection.cc.

Referenced by ThreadedSMTPConnection::setMyHostname().

int SMTPConnection::sendMail ( string &  from,
string &  to,
string &  msg 
)

Sends a mail via SMTP.

Parameters:
string& from FROM-email
string& to TO-email
string& msg Message-body of email. Should include additional headers like "Subject" etc.
Returns:
int status: 0 = success, -1 = error

Definition at line 804 of file SMTPConnection.cc.

Referenced by ThreadedSMTPConnection::Execute().

void SMTPConnection::disconnect (  ) 

When connected, disconnects from the SMTP-Server.

Definition at line 833 of file SMTPConnection.cc.

Referenced by ThreadedSMTPConnection::Execute(), and ~SMTPConnection().


The documentation for this class was generated from the following files:
Generated on Sat Oct 20 15:48:47 2007 for libSmtpThread by  doxygen 1.5.1