ConOpSys V2970  P004.07
ANVILEX control operating system
Classes | Macros | Typedefs | Functions
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:

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

◆ SMTP_RESULT_ERR_CLOSED

#define SMTP_RESULT_ERR_CLOSED   4

Connection unexpectedly closed by remote server

◆ SMTP_RESULT_ERR_CONNECT

#define SMTP_RESULT_ERR_CONNECT   2

Connection to server failed

◆ SMTP_RESULT_ERR_HOSTNAME

#define SMTP_RESULT_ERR_HOSTNAME   3

Failed to resolve server hostname

◆ SMTP_RESULT_ERR_MEM

#define SMTP_RESULT_ERR_MEM   7

Out of resources locally

◆ SMTP_RESULT_ERR_SVR_RESP

#define SMTP_RESULT_ERR_SVR_RESP   6

Server responded with an unknown response code

◆ SMTP_RESULT_ERR_TIMEOUT

#define SMTP_RESULT_ERR_TIMEOUT   5

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

◆ SMTP_RESULT_ERR_UNKNOWN

#define SMTP_RESULT_ERR_UNKNOWN   1

Unknown error

◆ SMTP_RESULT_OK

#define SMTP_RESULT_OK   0

Email successfully sent

◆ SMTPS_DEFAULT_PORT

#define SMTPS_DEFAULT_PORT   LWIP_IANA_PORT_SMTPS

The default TCP port used for SMTPS

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

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)