SMTP Client#
Functions#
Create an SMTP client. nitialize the client with a given configuration. This is a blocking API.
Send mail to the recipient from the SMTP client. This is non-blocking API.
Delete SMTP client. This is a non-blocking API.
Function Documentation#
rsi_smtp_client_create#
int32_t rsi_smtp_client_create (uint8_t flags, uint8_t * username, uint8_t * password, uint8_t * from_address, uint8_t * client_domain, uint8_t auth_type, uint8_t * server_ip, uint32_t port)
Create an SMTP client. nitialize the client with a given configuration. This is a blocking API.
[in] | flags | - Select IPV4/IPv6 version
| ||||||
[in] | username | - Username for authentication, must be a NULL terminated string | ||||||
[in] | password | - Password for authentication, must be a NULL terminated string | ||||||
[in] | from_address | - Sender's address, must be a NULL terminated string | ||||||
[in] | client_domain | - Domain name of the client, must be a NULL terminated string | ||||||
[in] | auth_type | - Client authentication type 1 - SMTP_CLIENT_AUTH_LOGIN 3 - SMTP_CLIENT_AUTH_PLAIN | ||||||
[in] | server_ip | - SMTP server IP address IPv4 address - 4 Bytes hexa-decimal IPv6 address - 16 Bytes hexa-decimal | ||||||
[in] | port | - SMTP server TCP port |
Note
This API is not supported in current release.
rsi_config_ipaddress() API needs to be called before this API.
Returns
0 - Success Negative Value - Failure -3 - Command given in wrong state -4 - Buffer not available to serve the command
54
of file network/protocols/rsi_smtp_client.c
rsi_smtp_client_mail_send_async#
int32_t rsi_smtp_client_mail_send_async (uint8_t * mail_recipient_address, uint8_t priority, uint8_t * mail_subject, uint8_t * mail_body, uint16_t mail_body_length, void(*)(uint16_t status, const uint8_t cmd_type) smtp_client_mail_response_handler)
Send mail to the recipient from the SMTP client. This is non-blocking API.
[in] | mail_recipient_address | - Mail recipient address |
[in] | priority | - Priority level at which mail is delivered 1 - RSI_SMTP_MAIL_PRIORITY_LOW 2 - RSI_SMTP_MAIL_PRIORITY_NORMAL 4 - RSI_SMTP_MAIL_PRIORITY_HIGH |
[in] | mail_subject | - Subject line text, a null terminated string. |
[in] | mail_body | - Mail message |
[in] | mail_body_length | - Length of the mail body |
[in] | smtp_client_mail_response_handler | - Callback when asynchronous response comes from the sent mail Status: status code cmd: sub command type |
Note
This API is not supported in current release.
rsi_config_ipaddress() API needs to be called before this API.
Returns
0 - Success Negative Value - Failure -3 - Command given in wrong state -4 - Buffer not available to serve the command
Note
1. The total maximum length of mail_recipient_address, mail_subject & mail_body is 1024 bytes
If status in callback is non-zero, then sub command type will be in 6th byte of the descriptor
261
of file network/protocols/rsi_smtp_client.c
rsi_smtp_client_delete_async#
int32_t rsi_smtp_client_delete_async (void(*)(uint16_t status, const uint8_t cmd_type) smtp_client_delete_response_handler)
Delete SMTP client. This is a non-blocking API.
[in] | smtp_client_delete_response_handler | - Callback when asynchronous response comes for the delete request status:Status code cmd : Sub-command type |
Note
This API is not supported in current release.
rsi_config_ipaddress, rsi_smtp_client_create API needs to be called before this API.
Returns
0 - Success Negative Value - Failure -3 - Command given in wrong state -4 - Buffer not available to serve the command
Note
If status in callback is non-zero, then sub-command type will be in 6th byte of the descriptor.
389
of file network/protocols/rsi_smtp_client.c