embOS/IP SMTP Client
The embOS/IP SMTP client is an optional extension which can be seamlessly inte- grated into your TCP/IP application. It combines a maximum of performance with a small memory footprint. The SMTP client allows an embedded system to send emails with dynamically generated content. The RAM usage of the SMTP client module has been kept to a minimum by smart buffer handling.
The SMTP client implements the relevant parts of the following Request For Com- ments (RFC).
| RFC# | Description |
|---|---|
| [RFC 821] | Simple Mail Transfer Protocol Direct download: ftp://ftp.rfc-editor.org/in-notes/rfc821.txt |
| [RFC 974] | Mail routing and the domain system Direct download: ftp://ftp.rfc-editor.org/in-notes/rfc821.txt |
| [RFC 5321] | Simple Mail Transfer Protocol Direct download: ftp://ftp.rfc-editor.org/in-notes/rfc5321.txt |
The following table shows the contents of the embOS/IP SMTP client root directory:
| Directory | Content |
|---|---|
| Application | Contains the example application to run the SMTP client with embOS/IP. |
| Config | Contains the SMTP client configuration file. Refer to Configuration on page 225 for detailed information. |
| Inc | Contains the required include files. |
| IP | Contains the SMTP client sources, IP_SMTPC.c and IP_SMTPC.h. |
| WindowsSMTPC | Contains the source, the project files and an executable to run embOS/IP SMTP cli- ent on a Microsoft Windows host. |
Supplied directory structure of embOS/IPSMTP client package
Feature list
- Low memory footprint.
- Independent of the TCP/IP stack: any stack with sockets can be used.
- Example applications included.
- Project for executable on PC for Microsoft Visual Studio included.
Requirements
TCP/IP stack
The embOS/IP SMTP client requires a TCP/IP stack. It is optimized for embOS/IP, but any RFC-compliant TCP/IP stack can be used. The shipment includes a Win32 simula- tion, which uses the standard Winsock API and an implementation which uses the socket API of embOS/IP.
Multi tasking
The SMTP client needs to run as a separate thread. Therefore, a multi tasking system is required to use the embOS/IP SMTP client.
SMTP backgrounds
The Simple Mail Transfer Protocol is a text based communication protocol for electronic mail transmission across IP networks.

Using SMTP, an embOS/IP application can transfer mail to an SMTP servers on the same network or to SMTP servers in other networks via a relay or gateway server accessible to both networks. When the embOS/IP SMTP client has a message to transmit, it establishes a TCP connection to an SMTP server and transmits after the handshaking the message content.
The handshaking mechanism includes normally an authentication process. The RFC's define the following four different authentication schemes:
- PLAIN
- LOGIN
- CRAM-MD5
- NTLM
In the current version, the embOS/IP SMTP client supports only PLAIN authentication.
The following listing shows a typical SMTP session:
S: 220 srv.sample.com ESMTP
C: HELO
S: 250 srv.sample.com
C: AUTH LOGIN
S: 334 VXNlcm5hbWU6
C: c3BzZXk29IulbkY29tZcZXIbtZ
S: 334 UGFzc3dvcmQ6
C: UlblhFz7ZlblsZlZQ==
S: 235 go ahead
C: Mail from:
S: 250 ok
C: Rcpt to:
S: 250 ok
C: Rcpt to:S: 250 ok
C: Rcpt to:
S: 250 ok
C: DATA
S: 354 go ahead
C: Message-ID: <1000.2234@sample.com>
C: From: "User0"
C: TO: "User1"
C: CC: "User2" , "User3"
C: Subject: Testmail
C: Date: 1 Jan 2008 00:00 +0100
C:
C: This is a test!
C:
C: .
S: 250 ok 1231221612 qp 3364
C: quit
S: 221 srv.sample.com
SMTP Client
Head office Germany
US office 
