MDK-ARM Keil, MDK-ARM Datasheet - Page 96

KIT REALVIEW MCU DEVELOPMENT

MDK-ARM

Manufacturer Part Number
MDK-ARM
Description
KIT REALVIEW MCU DEVELOPMENT
Manufacturer
Keil
Type
Compiler and IDEr
Datasheets

Specifications of MDK-ARM

For Use With/related Products
ARM MCUs
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
96
The final message string must be terminated with a period (.). Once the message
has been, sent the SMTP session will end and the user-defined callback function
will be called. A session code will be passed to the callback function. This
reports whether the SMTP session was successful and if not, why it failed.
static void smtp_cback (U8 code)
}
Exercise: Simple SMTP
This exercise presents the minimal code required to send a fixed email message.
Dynamic Message
It is possible to send dynamically created email messages. The sender and
recipient email addresses and the subject can be held as strings, so that different
addresses and subjects can be selected. The application software can also
dynamically generate the data sent in the message.
It is possible to send long email messages that contain application data. For each
call to the smtp_cbfunc() function, we can only send a packet of data with the
size of the buffer buf. However, we can force multiple calls to the smtp_cbfunc()
and build an email message that is larger than the buffer size.
typedef struct
} MY_BUF;
#define MYBUF(p) ((MY_BUF *) p)
First, we must declare a simple structure to control the construction of the email
data packets. In the structure above, the idx element counts the number of
packets sent, and id controls the flow of the smtp_cbfunc() switch statement.
switch (code)
}
U8
U16 idx;
case SMTP_EVT_SUCCESS:
case SMTP_EVT_TIMEOUT:
case SMTP_EVT_ERROR:
printf ("Email successfully sent\n");
sent = __TRUE;
break;
printf ("Mail Server timeout.\n");
break;
printf ("Error sending email.\n");
break;
id;
{
{
{
Chapter 4. RL-TCPnet Introduction

Related parts for MDK-ARM