SMTP data types. More...

Data Structures

struct gos_smtp_config_t
Configuration for sending SMTP message. More...

Typedefs

typedef gos_result_t (* gos_smtp_content_reader_t ) (void *user, void *data, uint32_t max_size, uint32_t *bytes_read)
SMTP message content reader callback. More...

Detailed Description

SMTP data types.

Typedef Documentation

gos_smtp_content_reader_t

typedef gos_result_t (* gos_smtp_content_reader_t) (void *user, void *data, uint32_t max_size, uint32_t *bytes_read)

SMTP message content reader callback.

This is used to read SMTP message content data which is then sent to the server. It allows for reading the data in chunks. It also allows for sending arbitrary length data.

If arbitrary length data is used (by setting the 'content_length' field of gos_smtp_config_t to 0) then when all data has been read, set the 'bytes_read' argument to 0

If NOt sending arbitrary length data (by setting the 'content_length' field of gos_smtp_config_t greater than 0) then when all data has been read this callback will stop being called.

Note
This callback is only called when the 'content' field of gos_smtp_config_t is NULL.
Parameters
[out] user User specified pointer. Same pointer as 'user' field in gos_smtp_config_t
[out] data Buffer to populate with STMP message content
[in] max_size Maximum size of data to populate
[out] bytes_read Number of bytes actually read
Returns
The gos_result_t of the data read