Network Component  
MDK Middleware for IPv4 and IPv6 Networking
 
Loading...
Searching...
No Matches
SMTP Client

SMTP is used to send e-mail notifications from an embedded system to various recipients. This example shows how to setup an SMTP client for this purpose.

The following picture shows an exemplary connection of the development board and a Computer.

SMTP client hardware setup

Project Organization

The SMTP Client project is available as part of the Network Reference examples.

Application Source Files

Following files implement application-specific logic in the example:

  • SMTP_Client.c contains the application main thread which initializes the Network Component and provides the information required to compose and send an email. The following changes are required:
    • Content of the email information in the structure mail:
      • Email addresses: From, To, Cc, Bcc
      • Subject and the message (body) of the email
      • Optional attachments and encoding type
    • Information about the SMTP server and the user credentials in the structure server:
      • Server name or IP address
      • Server port
      • User name and password

Software Components Configuration Files

Configuration files for the software components used in the project are located in the ./RTE/ directory and can be modified by users to adjust the operation of related components.

Following configuration files are provided with this example:

When a board layer is added to the project, corresponding configuration files for the board and device components will become available in the local ./Board/ directory.

Board Layer

In order to build the project it shall be extended with a compatible board layer that provides following interfaces as connections:

  • CMSIS_ETH: CMSIS-Driver for Ethernet interface
  • CMSIS_VIO: CMSIS-Driver for Virtual I/O interface
  • STDOUT: Standard Output redirection

Build the Project

Working with MDK-Middleware Examples explains the workflow for accessing, configuring and building an MDK-Middleware example project for your target hardware.

  1. Open the Network reference example.
  2. Make sure the compatible board layer is configured.
  3. Select SMTP_Client as an active project for the build process.
  4. Build the project and observe that no errors are reported.

Run the Example

Setup

Board-specific hardware setup such as jumpers, Ethernet ports, power supply, etc. is documented in the board layer description (README.md) of your selected target.

  1. Load the executable image to the target development board.
  2. Use an Ethernet cable to connect your development board to the local area network. The PC is assumed to be already in this LAN.

Example execution

If you have entered your personal e-mail address as the recipient's address, you only need to open your mail program and check your inbox.