libwebsockets
Lightweight C library for HTML5 websockets
Toggle main menu visibility
Loading...
Searching...
No Matches
lws-smtp-client.h
Go to the documentation of this file.
1
/*
2
* libwebsockets - small server side websockets and web server implementation
3
*
4
* Copyright (C) 2010 - 2026 Andy Green <andy@warmcat.com>
5
*
6
* Permission is hereby granted, free of charge, to any person obtaining a copy
7
* of this software and associated documentation files (the "Software"), to
8
* deal in the Software without restriction, including without limitation the
9
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10
* sell copies of the Software, and to permit persons to whom the Software is
11
* furnished to do so, subject to the following conditions:
12
*
13
* The above copyright notice and this permission notice shall be included in
14
* all copies or substantial portions of the Software.
15
*
16
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
* SOFTWARE.
23
*/
24
25
#ifndef _LWS_SMTP_CLIENT_H
26
#define _LWS_SMTP_CLIENT_H
27
59
60
#define LWS_SMTPC_PROTOCOL_NAME "lws-smtp-client"
61
62
typedef
enum
lws_smtpc_tls
{
63
LWS_SMTPC_TLS_NONE
,
65
LWS_SMTPC_TLS_IMPLICIT
,
67
LWS_SMTPC_TLS_STARTTLS
,
70
}
lws_smtpc_tls_t
;
71
72
typedef
enum
lws_smtpc_outcome
{
73
LWS_SMTPC_DELIVERED
,
75
LWS_SMTPC_REFUSED
,
77
LWS_SMTPC_GAVE_UP
,
81
LWS_SMTPC_ABANDONED
,
84
}
lws_smtpc_outcome_t
;
85
86
typedef
struct
lws_smtpc_result
{
87
lws_smtpc_outcome_t
outcome
;
88
int
code
;
90
const
char
*
text
;
92
}
lws_smtpc_result_t
;
93
106
typedef
void (*
lws_smtpc_done_cb_t
)(
void
*opaque,
const
lws_smtp_email_t
*email,
107
const
lws_smtpc_result_t
*res);
108
109
typedef
struct
lws_smtpc_info
{
110
struct
lws_vhost *
vhost
;
112
const
char
*
address
;
114
const
char
*
host
;
117
uint16_t
port
;
119
lws_smtpc_tls_t
tls
;
121
uint32_t
tls_flags
;
124
const
char
*
helo
;
126
const
lws_retry_bo_t
*
retry
;
132
uint16_t
max_queue
;
134
uint16_t
reply_timeout_secs
;
136
uint8_t
max_tries
;
138
}
lws_smtpc_info_t
;
139
140
struct
lws_smtpc;
141
142
#if defined(LWS_WITH_EMAIL)
143
155
LWS_VISIBLE
LWS_EXTERN
struct
lws_smtpc *
156
lws_smtpc_create(
const
lws_smtpc_info_t
*info);
157
167
LWS_VISIBLE
LWS_EXTERN
void
168
lws_smtpc_destroy(
struct
lws_smtpc **psmtpc);
169
193
LWS_VISIBLE
LWS_EXTERN
struct
lws_smtpc *
194
lws_smtpc_vhost(
struct
lws_vhost *vh);
195
212
LWS_VISIBLE
LWS_EXTERN
int
213
lws_smtpc_queue(
struct
lws_smtpc *smtpc,
const
lws_smtp_email_t
*email,
214
lws_smtpc_done_cb_t
cb,
void
*opaque);
215
216
#endif
217
219
220
#endif
lws_smtp_email_t
struct lws_smtp_email lws_smtp_email_t
lws_smtpc_info::retry
const lws_retry_bo_t * retry
Definition
lws-smtp-client.h:126
lws_smtpc_info::helo
const char * helo
Definition
lws-smtp-client.h:124
lws_smtpc_result::outcome
lws_smtpc_outcome_t outcome
Definition
lws-smtp-client.h:87
lws_smtpc_info::max_tries
uint8_t max_tries
Definition
lws-smtp-client.h:136
lws_smtpc_info::max_queue
uint16_t max_queue
Definition
lws-smtp-client.h:132
lws_smtpc_info::tls_flags
uint32_t tls_flags
Definition
lws-smtp-client.h:121
lws_smtpc_info::reply_timeout_secs
uint16_t reply_timeout_secs
Definition
lws-smtp-client.h:134
lws_smtpc_info::port
uint16_t port
Definition
lws-smtp-client.h:117
lws_smtpc_result::text
const char * text
Definition
lws-smtp-client.h:90
lws_smtpc_info::vhost
struct lws_vhost * vhost
Definition
lws-smtp-client.h:110
lws_smtpc_result::code
int code
Definition
lws-smtp-client.h:88
lws_smtpc_info::host
const char * host
Definition
lws-smtp-client.h:114
lws_smtpc_info::tls
lws_smtpc_tls_t tls
Definition
lws-smtp-client.h:119
lws_smtpc_info::address
const char * address
Definition
lws-smtp-client.h:112
lws_smtpc_tls_t
enum lws_smtpc_tls lws_smtpc_tls_t
lws_smtpc_done_cb_t
void(* lws_smtpc_done_cb_t)(void *opaque, const lws_smtp_email_t *email, const lws_smtpc_result_t *res)
Definition
lws-smtp-client.h:106
lws_smtpc_tls
lws_smtpc_tls
Definition
lws-smtp-client.h:62
lws_smtpc_info_t
struct lws_smtpc_info lws_smtpc_info_t
lws_smtpc_outcome
lws_smtpc_outcome
Definition
lws-smtp-client.h:72
lws_smtpc_result_t
struct lws_smtpc_result lws_smtpc_result_t
lws_smtpc_outcome_t
enum lws_smtpc_outcome lws_smtpc_outcome_t
LWS_SMTPC_TLS_NONE
@ LWS_SMTPC_TLS_NONE
Definition
lws-smtp-client.h:63
LWS_SMTPC_TLS_STARTTLS
@ LWS_SMTPC_TLS_STARTTLS
Definition
lws-smtp-client.h:67
LWS_SMTPC_TLS_IMPLICIT
@ LWS_SMTPC_TLS_IMPLICIT
Definition
lws-smtp-client.h:65
LWS_SMTPC_ABANDONED
@ LWS_SMTPC_ABANDONED
Definition
lws-smtp-client.h:81
LWS_SMTPC_DELIVERED
@ LWS_SMTPC_DELIVERED
Definition
lws-smtp-client.h:73
LWS_SMTPC_REFUSED
@ LWS_SMTPC_REFUSED
Definition
lws-smtp-client.h:75
LWS_SMTPC_GAVE_UP
@ LWS_SMTPC_GAVE_UP
Definition
lws-smtp-client.h:77
lws_smtpc_info
Definition
lws-smtp-client.h:109
lws_smtpc_result
Definition
lws-smtp-client.h:86
uint16_t
unsigned short uint16_t
Definition
libwebsockets.h:745
uint32_t
unsigned int uint32_t
Definition
libwebsockets.h:744
LWS_EXTERN
#define LWS_EXTERN
Definition
libwebsockets.h:327
uint8_t
unsigned char uint8_t
Definition
libwebsockets.h:746
LWS_VISIBLE
#define LWS_VISIBLE
Definition
libwebsockets.h:322
lws_retry_bo_t
struct lws_retry_bo lws_retry_bo_t
include
libwebsockets
lws-smtp-client.h
Generated on
for libwebsockets by
1.19.0