This is the first release of libSmtpThread, a threaded SMTP-library.

This library provides some simple C++ classes, which try to make your 
email-sending-life easier.

The classes are:

- Thread
- SMTPConnection
- ThreadedSMTPConnection
- SMTPConnectionPool

Well, in most cases you will just utilize the "SMTPConnectionPool". All
classes are located in the namespace "SmtpThread".

The connection-pool initializes a pool of threaded smtp-connections to the 
specified smtp-server. Then you direct your emails to the connection-pool. 
The pool accepts your email and delivers it to a free connection. The 
connection stores your email and immediatly returns. The delivery to the 
smtp-server is processed in a separate thread, so you don't have to wait
for a mail to be accepted by the receiving smtp-server.


Typical usage:
====================[cut here]====================
#include <iostream>
#include <sstream>
#include <stdlib.h>
#include <string>
#include <stdio.h>
#include <stdlib.h>
#include <smtpthread/SMTPConnectionPool.h>

using namespace std;
using namespace SmtpThread;

int main(int argc, char** argv) {
    
    string ip = "127.0.0.1";      // SMTP-Server
    string host = "localhost";    // for HELO-command
    string to = "you@localhost";  // sender-email
    string from = "me@localhost"; // recipient-email
    string port = "25";           // SMTP-port
    
    using namespace std;

    mailbody  = "From: \"me@localhost\"\n";
    mailbody += "To: \"you@remotehost\"\n";
    mailbody += "Subject: This is a test\n";
    mailbody += "\n";
    mailbody += "This is the first line of the body.\n";
    mailbody += "This is the second line of the body.\n";
    
    SMTPConnectionPool pool;
    
    pool.setMyHostname( host );
    pool.setSMTPHost( ip );
    pool.setSMTPPort( portNumber );
    pool.setMaxPoolSize( 100 );
    pool.setMinPoolSize( 1 );
    pool.setPoolSize( 10 );
    pool.setOptimizePool( true );
    
    int success = 0;
    int error   = 0;
    int result  = 0;

    for( int idx = 0; idx < 1000; idx++ )
    {
        result = pool.sendMail( from, to, mailbody  );
        if( result == 0 ) ++success;
        else ++error;
    }

    cout << "Success: " << success << endl;
    cout << "Errors:  " << error   << endl;
    
}
====================[cut here]====================


SMTP
====
At the moment libSmtpThread speaks plain SMTP. Nothing else. No ESMTP 
no SMTP/TLS no SMTP over SSL. The library has bee tested successfully talking
to the Postfix-mailserver. Talking to other Mailservers might work or not. It's 
your turn to find out. ;)


Using libSmtpThread With SunStudio
==================================
For those of you working with SunStudio just rename "Makefile.sunstudio" into 
"Makefile" and import the complete folder into SunStudio. Build the project as 
usual. You'll find the library in "dist/Release/Sun12-Linux-x86/".


Using libSmtpThread with GNU autotools
======================================
On most systems you should have no problems installing the library as usual 
with "configure", "make" and "make install".


When linkng against libSmtpThread, remember to also link against "libpthread".


BUG-REPORTS
===========
Please send bug-reports to <marcus@beranek.de>.


LICENSE
=======
This software is published under the GNU LESSER GENERAL PUBLIC LICENSE.
See the file "LICENSE" for more details.


WARRANTY
========
Sorry, no warranty! This software is published "AS IS". The author may not be
held responsible for any problems, malfunctions or damage caused by this 
software directly or indirectly. See sections 15 and 16 of the GPL.


IMPORTANT
=========
DO NOT USE THIS LIBRARY TO SEND SPAM-MAILS!

