Thank you for your interest in the Simple SMTP Client class. This class was built after discovering how horrendously difficult the SMTP class that is included with Borland C++Builder is to implement. The focus is on simple mail usage in an easy to follow manner. Installation ============ Using the SSMTPClient class is a three step process. Step 1: Add SSMTPClient to your project: A. Download and unzip the SSMTPClient files into a directory (i.e. $(BCBROOT)/Addons/SSMTPClient). B. Add the SSMTPClient.cpp file to your project (Project->Add To Project) C. Add a #include "SSMTPClient.h" to the source file that will be calling SSMTPClient Step 2: Add Support routines to your project: A. Download and unzip the BCBMD5 and Base64 classes from my website (both are free) B. Unzip them into a directory (I use $(BCBROOT)/Addons/MyUtils) C. Follow the steps above to add BCBMD5.c, MD5.c, Base64.c to your project Step 3: Add the appropriate function calls to your program. The basic steps are: A. Login B. Authenticate C. Send a mail message D. Logout. What SSMTPClient Is ================== There should be nothing complex about sending mail. The SMTP RFC, while slightly more complex than the POP RFC, is still quite simple and clear. I found the folks selling a POP/SMTP client for $1000(USD) on the net amusing. The most difficult part about SMTP is creating the authentication response, and this handles that for you. SSMPTClient supports four types of (optional) authentication: PLAIN, LOGIN, CRAM-MD5 and DIGEST-MD5. More can be easily added, but that's all that the mail servers that I have access to use. SSMTPClient will allow you to send email via a standard SMTP server, and implements some of the non-required commands as well. It is very small, very easy to use, and all code will be included in your executable. What SSMTPClient Is Not ====================== SSMTPClient is not a VCL component, it does not need to be created with "new", it does not generate any events, and it does not install into the pallette. It does not implement the "send", "saml", or "soml" commands, as as no one really uses those anymore. The Public Interface ==================== SSMTPClient exposes a minimum set of methods to send mail. It does no memory management (i.e. any object pointers, such as TSTrings objects, must be created and deleted in your program). All of the methods return a boolean value, where true indicates success and false indicates failure. In the event of a failure, you can read ErrorMsg for an error string. There are two ways to send mail - single destination or multiple destination. (Note that these are due to my design, and not part of the SMTP RFC). In single destination mode, you simply provide AnsiString objects for From, To, and Subject, and a TStrings pointer for the body. In multiple destination mode, you must provide TStrings pointers (or a descendant class, such as TSTringList) for the To, CC, and BCC options. You can send a NULL pointer for any of these three objects, and they will be ignored. So if you want to send an email, but with only Blind CC recipients, you would leave the To and CC objects NULL, and send a list of destination address in the BCC list. SSMTPClient also adds one property of interest. For the "multiple destination mode" Mail method, there is a chance that one of the recipients will not be able to be validated. Rather than failing the entire send, that recipient can be skipped (and no error generated) by setting the FailOnBadTo property to false. The Authenticate routine will attempt to use the known authentication methods from strongest to weakest (i.e. Digest-MD5, CRAM-MD5, LOGIN, PLAIN). If none succeed, or none match what's available from the server, authentication will fail, but you will still be able to send mail, it probably just won't relay (send mail outside your domain). SSMTPClient supports the following "core" methods: Login(AnsiString Host, AnsiString User) Mail(AnsiString From, AnsiString To, AnsiString Subject, TStringList *Body) Mail(AnsiString From, TStringList *To, TStringList *CC, TStringList *BCC, AnsiString Subject, TStringList *Body) Logout(void) SSMTPClient also supports the following "extended" methods: Authenticate(AnsiString UserName, AnsiString Password); Verify(AnsiString UserName) Expand(AnsiString ListName, TStringList *UserList) SSMTPClient has two user-accessible properties: AnsiString ErrorMsg bool FailOnBadTo The Details =========== SSMTPClient uses a TTcpClient session to control the session with the pop server. All communications are done in blocking mode, and the port is preset to 25.