ReactOS 0.4.16-dev-297-gc569aee
smtp.h File Reference
#include "lwip/apps/smtp_opts.h"
#include "lwip/err.h"
#include "lwip/prot/iana.h"
Include dependency graph for smtp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  smtp_send_request
 

Macros

#define SMTP_DEFAULT_PORT   LWIP_IANA_PORT_SMTP
 
#define SMTPS_DEFAULT_PORT   LWIP_IANA_PORT_SMTPS
 
#define SMTP_RESULT_OK   0
 
#define SMTP_RESULT_ERR_UNKNOWN   1
 
#define SMTP_RESULT_ERR_CONNECT   2
 
#define SMTP_RESULT_ERR_HOSTNAME   3
 
#define SMTP_RESULT_ERR_CLOSED   4
 
#define SMTP_RESULT_ERR_TIMEOUT   5
 
#define SMTP_RESULT_ERR_SVR_RESP   6
 
#define SMTP_RESULT_ERR_MEM   7
 

Typedefs

typedef void(* smtp_result_fn) (void *arg, u8_t smtp_result, u16_t srv_err, err_t err)
 

Functions

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)
 
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)
 

Macro Definition Documentation

◆ SMTP_DEFAULT_PORT

#define SMTP_DEFAULT_PORT   LWIP_IANA_PORT_SMTP

The default TCP port used for SMTP

Definition at line 13 of file smtp.h.

◆ SMTP_RESULT_ERR_CLOSED

#define SMTP_RESULT_ERR_CLOSED   4

Connection unexpectedly closed by remote server

Definition at line 26 of file smtp.h.

◆ SMTP_RESULT_ERR_CONNECT

#define SMTP_RESULT_ERR_CONNECT   2

Connection to server failed

Definition at line 22 of file smtp.h.

◆ SMTP_RESULT_ERR_HOSTNAME

#define SMTP_RESULT_ERR_HOSTNAME   3

Failed to resolve server hostname

Definition at line 24 of file smtp.h.

◆ SMTP_RESULT_ERR_MEM

#define SMTP_RESULT_ERR_MEM   7

Out of resources locally

Definition at line 32 of file smtp.h.

◆ SMTP_RESULT_ERR_SVR_RESP

#define SMTP_RESULT_ERR_SVR_RESP   6

Server responded with an unknown response code

Definition at line 30 of file smtp.h.

◆ SMTP_RESULT_ERR_TIMEOUT

#define SMTP_RESULT_ERR_TIMEOUT   5

Connection timed out (server didn't respond in time)

Definition at line 28 of file smtp.h.

◆ SMTP_RESULT_ERR_UNKNOWN

#define SMTP_RESULT_ERR_UNKNOWN   1

Unknown error

Definition at line 20 of file smtp.h.

◆ SMTP_RESULT_OK

#define SMTP_RESULT_OK   0

Email successfully sent

Definition at line 18 of file smtp.h.

◆ SMTPS_DEFAULT_PORT

#define SMTPS_DEFAULT_PORT   LWIP_IANA_PORT_SMTPS

The default TCP port used for SMTPS

Definition at line 15 of file smtp.h.

Typedef Documentation

◆ smtp_result_fn

typedef void(* smtp_result_fn) (void *arg, u8_t smtp_result, u16_t srv_err, err_t err)

Prototype of an smtp callback function

Parameters
argargument specified when initiating the email
smtp_resultresult of the mail transfer (see defines SMTP_RESULT_*)
srv_errif aborted by the server, this contains the error code received
erran error returned by internal lwip functions, can help to specify the source of the error but must not necessarily be != ERR_OK

Definition at line 42 of file smtp.h.

Function Documentation

◆ smtp_send_mail()

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_send_mail_int()

void smtp_send_mail_int ( void arg)

◆ smtp_send_mail_static()

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 
)

◆ smtp_set_auth()

err_t smtp_set_auth ( const char username,
const char pass 
)

◆ smtp_set_server_addr()

err_t smtp_set_server_addr ( const char server)

◆ smtp_set_server_port()

void smtp_set_server_port ( u16_t  port)