Skip to end of metadata
Go to start of metadata

This section describes the examples that are related to the Micrium OS SMTP Client module.

SMTP Client Initialization Example

Description

This is a generic example that shows how to initialize the SMTP client module. 

Configuration

Mandatory

The following #define must be added in ex_description.h to allow other examples to initialize the SNTP Client module correctly:

#defineDescription
EX_SMTP_CLIENT_INIT_AVAILLets the upper example layer know that the SMTP Client Initialization example is present and must be called by other examples.


Location

  • /examples/net/smtp/ex_smtp_client.c
  • /examples/net/smtp/ex_smtp_client.h

API

APIDescription

Ex_SMTP_Client_Init()

Initialize the Micrium OS SMTP Client module for the example application.

Notes

None.

SMTP Client Send Email Example

Description

This is a simple example that sends an email.

Configuration

Mandatory

The following #define must be added in ex_description.h to allow other examples to initialize the SNTP Client module correctly:

#defineDescription
EX_SMTPc_SERVER_ADDRSpecify the SMTP server address to use. One should be provided by your ISP or by your organization.
Note that the default value is invalid ("smtp.isp.com").
EX_SMTPc_TO_ADDRSpecify the destination email address, i.e. you email address.
Note that the default value is invalid ("test_to@gmail.com"). 

Optional

The following #define can be added to ex_description.h, as described in Example Applications section, to change default configuration value used by the example:

#defineDefault valueDescription
EX_SMTPc_FROM_NAME"From Name"Specify the displayed name of the sender
EX_SMTPc_FROM_ADDR"test_from@gmail.com"Specify the email address of the sender
EX_SMTPc_USERNAMEDEF_NULLSpecify a username, if null no authentication is applied.
EX_SMTPc_PWDEF_NULLSpecify a password.
EX_SMTPc_MSG_SUBJECT"Example Title"Specify the email subject
EX_SMTPc_MSG_BODY"Example email sent using Micrium OS"Specify the email body
EX_TRACE

printf(__VA_ARGS__)

Specify the function used to output information

Location

  • /examples/net/smtp/ex_smtp_client.c
  • /examples/net/smtp/ex_smtp_client.h

API

APIDescription

Ex_SMTP_Client_SendMail()

Send an email