Overview
HS SMTP is a software library in C (supplied with full source code) which implements the client side of Simple Mail Transfer Protocol (SMTP) over TCP socket layer according to RFC 821. Support for transfer of basic message header and text is provided
HS SMTP supports ESMTP extension for LOGIN Authentication using Base64 encoding and message sending to multiple recipients from address list.
HS SMTP supports sending binary file attachments using MIME version 1.0 base64 encoding.
SMTP supports secure SMTP over TLS / SSL (RFC 3207) both using STARTTLS mechanism and using SSL on a dedicated port without STARTTLS
The use of HS SMTP C Source Library is Royalty Free.
HS SMTP includes the C source for the following platforms:
Windows
Linux
Embedded Systems
Windows CE 5.0+ (ask for details)
Features
- SMTP Client Operation
- Server name resolution
- Message Header Transfer
- Message Text Transfer
- Asynchonous Operation
- ESMTP extension for authentication using LOGIN base64 encoding
- Message sending to multiple recipients specified in TO and CC fields
- Message sending to multiple recipients from address list
- Sending binary file attachments using MIME version 1.0 base64 encoding
- Secure SMTP over TLS (RFC 3207) using STARTTLS method
- Secure SMTP over SSL (legacy method on dedicated port)
- SMTP C Source Code can be used on Windows, Linux and Embedded Systems
How It Works
To send a text email message to any address on the internet, the user application calls a single function HsSmtpSendMail, specifying mail server name or IP address, sender address, recipient address, message text buffer and length, subject, cc and an event callback function to use for reporting of operation result and server errors.
HS SMTP library then resolves the server name, connects to it and transmits the message according to SMTP RFC 821 protocol. HS SMTP Library incorporates the necessary state machine, transparency procedures, and server response processing required to comply to a simple and robust SMTP client implementation.
Modular design makes it easy to port HS SMTP protocol module to any environment. HS SMTP internally at a lower layer interfaces to HS Sock library which provides TCP transport services. User application need not worry about Winsock - HS SMTP does all transmission, reception and event handling over socket layer.
API Summary
- HsSmtpInit
- HsSmtpDestroy
- HsSmtpTick
- HsSmtpSendMail
- HsSmtpAbortMail
- HsSmtpContinue
HS SMTP Library Architecture
HS SMTP product includes SMTP protocol library, socket interface library and demo applications:
Secure SMTP Implementation Details
Secure SMTP over TLS / SSL is implemented according RFC 3207. If secure SMTP support is requested in parameters to HsSmtpSendMail API function, HS SMTP shall issue STARTTLS command once TCP connection is established to SMTP server.
Support for SSL / TLS is implemented in HsSock library (which is included with HsSmtp).
HsSock library has a compile option to incude SSL support or not. Is SSL support is compiled in, HsSock library interfaces to OpenSSL API in order to manage SSL connections, secure negotiation and data encryption and decryption.
OpenSSL binaries are supplied with HSSMTP Demo application.
In order to compile HS SMTP library with SSL support user must have installed OpenSSL. The HS SMTP project file must be adjusted to point it to include OpenSSL header files from correct directory.
SSL support is optional and it is possible to use HS SMTP without OpenSSL. To do that HsSock compile option must be changed not to include SSL support.
* This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit
Customization
Hillstone Software provides additional services for customization, porting and integration of the library code to better suit the needs of your products
