#include <rtl.h>
BOOL smtp_connect (
U8* ipadr, /* IP address of the SMTP server. */
U16 port, /* Port number of SMTP server. */
void (*cbfunc)(U8 event) ); /* Function to call when the SMTP session ends. */
Description
The smtp_connect function starts the SMTP client on the
TCPnet system. This causes the SMTP client to then start an SMTP
session by connecting to an SMTP server on the TCP port
specified in the function argument.
The argument ipadr points to an array of 4 bytes containing
the dotted-decimal notation of the IP address of the SMTP server to
connect to.
The argument cbfunc points to a function that the SMTP
client running on TCPnet calls when the SMTP session ends. The
cbfunc is an event callback function that uses the
event argument of the cbfunc function to signal one of
the following SMTP events:
Event
Description
SMTP_EVT_SUCCESS
The email has been successfully sent.
SMTP_EVT_TIMEOUT
SMTP Server response has timed out, and hence the SMTP client
has aborted the operation. The email has not been sent.
SMTP_EVT_ERROR
Protocol error occurred when sending the email. The email has
not been sent.
The smtp_connect function is in the RL-TCPnet library. The
prototype is defined in rtl.h.
note
The standard SMTP port is TCP port 25.
Your application, running on TCPnet, can call the
smtp_connect function to connect to an SMTP server to send
emails.
Return Value
The smtp_connect function returns __TRUE if the SMTP client
has been successfully started. Otherwise it returns __FALSE.
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.