lwIP
2.1.0
Lightweight IP stack
|
Modules | |
Options | |
Functions | |
err_t | smtp_set_server_addr (const char *server) |
void | smtp_set_server_port (u16_t port) |
void | smtp_set_tls_config (struct altcp_tls_config *tls_config) |
err_t | smtp_set_auth (const char *username, const char *pass) |
err_t | smtp_send_mail (const char *from, const char *to, const char *subject, const char *body, smtp_result_fn callback_fn, void *callback_arg) |
err_t | smtp_send_mail_static (const char *from, const char *to, const char *subject, const char *body, smtp_result_fn callback_fn, void *callback_arg) |
void | smtp_send_mail_int (void *arg) |
This is simple SMTP client for raw API. It is a minimal implementation of SMTP as specified in RFC 5321.
Example usage:
When using from any other thread than the tcpip_thread (for NO_SYS==0), use smtp_send_mail_int()!
SMTP_BODYDH usage:
err_t smtp_send_mail | ( | const char * | from, |
const char * | to, | ||
const char * | subject, | ||
const char * | body, | ||
smtp_result_fn | callback_fn, | ||
void * | callback_arg | ||
) |
Send an email via the currently selected server, username and password.
from | source email address (must be NULL-terminated) |
to | target email address (must be NULL-terminated) |
subject | email subject (must be NULL-terminated) |
body | email body (must be NULL-terminated) |
callback_fn | callback function |
callback_arg | user argument to callback_fn |
void smtp_send_mail_int | ( | void * | arg | ) |
Same as smtp_send_mail but takes a struct smtp_send_request as single parameter which contains all the other parameters. To be used with tcpip_callback to send mail from interrupt context or from another thread.
WARNING: server and authentication must stay untouched until this function has run!
Usage example:
err_t smtp_send_mail_static | ( | const char * | from, |
const char * | to, | ||
const char * | subject, | ||
const char * | body, | ||
smtp_result_fn | callback_fn, | ||
void * | callback_arg | ||
) |
Same as smtp_send_mail, but doesn't copy from, to, subject and body into an internal buffer to save memory. WARNING: the above data must stay untouched until the callback function is called (unless the function returns != ERR_OK)
err_t smtp_set_auth | ( | const char * | username, |
const char * | pass | ||
) |
Set authentication parameters for next SMTP connection
username | login name as passed to the server |
pass | password passed to the server together with username |
err_t smtp_set_server_addr | ( | const char * | server | ) |
Set IP address or DNS name for next SMTP connection
server | IP address (in ASCII representation) or DNS name of the server |
void smtp_set_server_port | ( | u16_t | port | ) |
Set TCP port for next SMTP connection
port | TCP port |
void smtp_set_tls_config | ( | struct altcp_tls_config * | tls_config | ) |
Set TLS configuration for next SMTP connection
tls_config | TLS configuration |