SmtpThread::ThreadedSMTPConnection Class Reference

#include <ThreadedSMTPConnection.h>

Inherits SmtpThread::Thread.

Inheritance diagram for SmtpThread::ThreadedSMTPConnection:

Inheritance graph
[legend]
Collaboration diagram for SmtpThread::ThreadedSMTPConnection:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ThreadedSMTPConnection ()
 ThreadedSMTPConnection (string host)
 ThreadedSMTPConnection (string host, string myname)
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.


Constructor & Destructor Documentation

SmtpThread::ThreadedSMTPConnection::ThreadedSMTPConnection (  ) 

Default constructor.

SmtpThread::ThreadedSMTPConnection::ThreadedSMTPConnection ( string  host  ) 

Constructor. Initializes the smtp-connection to "host".

Parameters:
host IP-address of the host to connect to.

SmtpThread::ThreadedSMTPConnection::ThreadedSMTPConnection ( string  host,
string  myname 
)

Constructor. Initializes the smtp-connection to "host" and uses myname as hostname.

Parameters:
host IP-address of the host to connect to.
myname hostname for the HELO-command.


Member Function Documentation

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

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

Parameters:
arg pointer to the arguments.
See also:
Thread::Execute

Reimplemented from SmtpThread::Thread.

bool SmtpThread::ThreadedSMTPConnection::isReady (  ) 

Returns the current status of the thread.

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

SMTPConnection::SMTPState SmtpThread::ThreadedSMTPConnection::getSMTPState (  ) 

Returns the current state of the SMTP-dialog.

Returns:
state of the current connection.

void SmtpThread::ThreadedSMTPConnection::setSMTPHost ( string  host  ) 

Sets the IP-address of the SMTP-server.

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

Parameters:
host IP-adress of SMTP-server.

void SmtpThread::ThreadedSMTPConnection::setSMTPPort ( int  port  ) 

Sets the port-number to connect to.

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

void SmtpThread::ThreadedSMTPConnection::setMyHostname ( string  myname  ) 

Sets the hostname to send within the HELO-command.

Parameters:
myname Hostname of the sending host.

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

Send an email to the SMTP-server.

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


Generated on Sun Dec 2 13:20:08 2007 for libSmtpThread by  doxygen 1.5.1