ThreadedSMTPConnection Class Reference

#include <ThreadedSMTPConnection.h>

Inherits Thread.

Inheritance diagram for ThreadedSMTPConnection:

Inheritance graph
[legend]
Collaboration diagram for ThreadedSMTPConnection:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ThreadedSMTPConnection ()
void Execute (void *arg)
bool isReady ()
SMTPConnection::SMTPState getSMTPState ()
void setSMTPHost (string host)
void setSMTPPort (int port)
void setMyHostname (string myname)
void sendMail (string &from, string &to, string &msg)

Detailed Description

ThreadedSMTPConnection-Class.

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

ThreadedSMTPConnection speaks plain SMTP, no ESMTP.

Definition at line 47 of file ThreadedSMTPConnection.h.


Constructor & Destructor Documentation

ThreadedSMTPConnection::ThreadedSMTPConnection (  ) 

Default constructor.

Definition at line 34 of file ThreadedSMTPConnection.cc.


Member Function Documentation

void ThreadedSMTPConnection::Execute ( void *  arg  )  [virtual]

The main thread-loop. Checks whether or not a mail is provided to the object and sends the mail.

Reimplemented from Thread.

Definition at line 49 of file ThreadedSMTPConnection.cc.

References Thread::_isRunning, SMTPConnection::disconnect(), Thread::getLock(), Thread::releaseLock(), and SMTPConnection::sendMail().

Here is the call graph for this function:

bool ThreadedSMTPConnection::isReady (  ) 

Returns the current status of the thread.

Returns:
bool true / false = thread is ready / is not ready to accept mssages.

Definition at line 133 of file ThreadedSMTPConnection.cc.

Referenced by SMTPConnectionPool::sendMail().

SMTPConnection::SMTPState ThreadedSMTPConnection::getSMTPState (  ) 

Returns the current state of the SMTP-dialog.

Definition at line 149 of file ThreadedSMTPConnection.cc.

References SMTPConnection::getSMTPState().

Here is the call graph for this function:

void ThreadedSMTPConnection::setSMTPHost ( string  host  ) 

Sets the IP-address of the SMTP-server.

NOTE: Must be an IP-address and not a domain-name!

Parameters:
string host IP-adress of SMTP-server.

Definition at line 192 of file ThreadedSMTPConnection.cc.

References Thread::getLock(), Thread::releaseLock(), and SMTPConnection::setSMTPHost().

Referenced by SMTPConnectionPool::setSMTPHost().

Here is the call graph for this function:

void ThreadedSMTPConnection::setSMTPPort ( int  port  ) 

Sets the port-number to connect to.

Parameters:
int port Port-number of the SMTP-server.

Definition at line 216 of file ThreadedSMTPConnection.cc.

References Thread::getLock(), Thread::releaseLock(), and SMTPConnection::setSMTPPort().

Referenced by SMTPConnectionPool::setSMTPPort().

Here is the call graph for this function:

void ThreadedSMTPConnection::setMyHostname ( string  myname  ) 

Sets the hostname to send within the HELO-command.

Parameters:
string myname Hostname of the sending host.

Definition at line 236 of file ThreadedSMTPConnection.cc.

References Thread::getLock(), Thread::releaseLock(), and SMTPConnection::setMyHostname().

Referenced by SMTPConnectionPool::setMyHostname().

Here is the call graph for this function:

void ThreadedSMTPConnection::sendMail ( string &  from,
string &  to,
string &  msg 
)

Send an email to the SMTP-server.

Parameters:
string from email-address of the sender.
string to email-address of the receiver.
string msg email-body, including all additional headers.

Definition at line 166 of file ThreadedSMTPConnection.cc.

References Thread::getLock(), and Thread::releaseLock().

Referenced by SMTPConnectionPool::sendMail().

Here is the call graph for this function:


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