ReactOS 0.4.16-dev-297-gc569aee
smtp.h
Go to the documentation of this file.
1#ifndef LWIP_HDR_APPS_SMTP_H
2#define LWIP_HDR_APPS_SMTP_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
9#include "lwip/err.h"
10#include "lwip/prot/iana.h"
11
13#define SMTP_DEFAULT_PORT LWIP_IANA_PORT_SMTP
15#define SMTPS_DEFAULT_PORT LWIP_IANA_PORT_SMTPS
16
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
33
42typedef void (*smtp_result_fn)(void *arg, u8_t smtp_result, u16_t srv_err, err_t err);
43
55 const char *from;
56 const char* to;
57 const char* subject;
58 const char* body;
66};
67
68
69#if SMTP_BODYDH
70
71#ifndef SMTP_BODYDH_BUFFER_SIZE
72#define SMTP_BODYDH_BUFFER_SIZE 256
73#endif /* SMTP_BODYDH_BUFFER_SIZE */
74
75struct smtp_bodydh {
77 u16_t length; /* Length of content in buffer */
78 char buffer[SMTP_BODYDH_BUFFER_SIZE]; /* buffer for generated content */
79#ifdef SMTP_BODYDH_USER_SIZE
80 u8_t user[SMTP_BODYDH_USER_SIZE];
81#endif /* SMTP_BODYDH_USER_SIZE */
82};
83
84enum bdh_retvals_e {
85 BDH_DONE = 0,
86 BDH_WORKING
87};
88
100typedef int (*smtp_bodycback_fn)(void *arg, struct smtp_bodydh *bodydh);
101
102err_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);
104
105#endif /* SMTP_BODYDH */
106
107
110#if LWIP_ALTCP && LWIP_ALTCP_TLS
111struct altcp_tls_config;
112void smtp_set_tls_config(struct altcp_tls_config *tls_config);
113#endif
114err_t smtp_set_auth(const char* username, const char* pass);
115err_t smtp_send_mail(const char *from, const char* to, const char* subject, const char* body,
116 smtp_result_fn callback_fn, void* callback_arg);
117err_t smtp_send_mail_static(const char *from, const char* to, const char* subject, const char* body,
118 smtp_result_fn callback_fn, void* callback_arg);
120#ifdef LWIP_DEBUG
121const char* smtp_result_str(u8_t smtp_result);
122#endif
123
124#ifdef __cplusplus
125}
126#endif
127
128#endif /* LWIP_HDR_APPS_SMTP_H */
static int state
Definition: maze.c:121
void user(int argc, const char *argv[])
Definition: cmds.c:1350
USHORT port
Definition: uri.c:228
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
GLuint buffer
Definition: glext.h:5915
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
uint8_t u8_t
Definition: arch.h:125
uint16_t u16_t
Definition: arch.h:127
s8_t err_t
Definition: err.h:96
static WCHAR username[]
Definition: url.c:32
#define err(...)
static const void * body(MD5_CTX *ctx, const void *data, unsigned long size)
Definition: md5.c:100
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)
CardRegion * from
Definition: spigame.cpp:19
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
pass
Definition: typegen.h:25
static rfbScreenInfoPtr server
Definition: vnc.c:74
void * arg
Definition: msvc.h:10