1 #ifndef LWIP_HDR_APPS_SMTP_H
2 #define LWIP_HDR_APPS_SMTP_H
13 #define SMTP_DEFAULT_PORT LWIP_IANA_PORT_SMTP
15 #define SMTPS_DEFAULT_PORT LWIP_IANA_PORT_SMTPS
18 #define SMTP_RESULT_OK 0
20 #define SMTP_RESULT_ERR_UNKNOWN 1
22 #define SMTP_RESULT_ERR_CONNECT 2
24 #define SMTP_RESULT_ERR_HOSTNAME 3
26 #define SMTP_RESULT_ERR_CLOSED 4
28 #define SMTP_RESULT_ERR_TIMEOUT 5
30 #define SMTP_RESULT_ERR_SVR_RESP 6
32 #define SMTP_RESULT_ERR_MEM 7
71 #ifndef SMTP_BODYDH_BUFFER_SIZE
72 #define SMTP_BODYDH_BUFFER_SIZE 256
78 char buffer[SMTP_BODYDH_BUFFER_SIZE];
79 #ifdef SMTP_BODYDH_USER_SIZE
80 u8_t user[SMTP_BODYDH_USER_SIZE];
100 typedef int (*smtp_bodycback_fn)(
void *arg,
struct smtp_bodydh *bodydh);
102 err_t smtp_send_mail_bodycback(
const char *from,
const char* to,
const char* subject,
103 smtp_bodycback_fn bodycback_fn,
smtp_result_fn callback_fn,
void* callback_arg);
110 #if LWIP_ALTCP && LWIP_ALTCP_TLS
111 struct altcp_tls_config;
112 void smtp_set_tls_config(
struct altcp_tls_config *tls_config);
121 const char* smtp_result_str(
u8_t smtp_result);
uint8_t u8_t
Definition: arch.h:125
uint16_t u16_t
Definition: arch.h:127
s8_t err_t
Definition: err.h:96
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)
err_t smtp_set_server_addr(const char *server)
void smtp_set_server_port(u16_t port)
err_t smtp_set_auth(const char *username, const char *pass)
void(* smtp_result_fn)(void *arg, u8_t smtp_result, u16_t srv_err, err_t err)
Definition: smtp.h:42
void smtp_send_mail_int(void *arg)
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)
smtp_result_fn callback_fn
Definition: smtp.h:59
const char * body
Definition: smtp.h:58
const char * to
Definition: smtp.h:56
const char * from
Definition: smtp.h:55
u8_t static_data
Definition: smtp.h:65
void * callback_arg
Definition: smtp.h:60
const char * subject
Definition: smtp.h:57