acl/lib_protocol/include/smtp/smtp_client.h

207 lines
6.8 KiB
C
Raw Normal View History

#ifndef __SMTP_CLIENT_INCLUDE_H__
2014-11-19 00:25:21 +08:00
#define __SMTP_CLIENT_INCLUDE_H__
/* #include "lib_acl.h" */
2014-11-19 00:25:21 +08:00
#ifdef __cplusplus
extern "C" {
#endif
#ifdef SMTP_LIB
# ifndef SMTP_API
# define SMTP_API
# endif
#elif defined(SMTP_DLL) || defined(_WINDLL)
# if defined(SMTP_EXPORTS) || defined(protocol_EXPORTS)
# ifndef SMTP_API
# define SMTP_API __declspec(dllexport)
# endif
# elif !defined(SMTP_API)
2014-11-19 00:25:21 +08:00
# define SMTP_API __declspec(dllimport)
# endif
#elif !defined(SMTP_API)
# define SMTP_API
2014-11-19 00:25:21 +08:00
#endif
typedef struct SMTP_CLIENT {
ACL_VSTREAM *conn;
int smtp_code;
char* buf;
int size;
unsigned int flag;
#define SMTP_FLAG_PIPELINING (1 << 0)
#define SMTP_FLAG_AUTH (1 << 1)
#define SMTP_FLAG_8BITMIME (1 << 2)
#define SMTP_FLAG_DSN (1 << 3)
#define SMTP_FLAG_VRFY (1 << 4)
#define SMTP_FLAG_ETRN (1 << 5)
#define SMTP_FLAG_SIZE (1 << 6)
int message_size_limit;
} SMTP_CLIENT;
/**
* Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SMTP <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param addr {const char*} SMTP <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD>domain:port
* @param conn_timeout {int} <EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD>ʱʱ<EFBFBD><EFBFBD>
* @param rw_timeout {int} IO<EFBFBD><EFBFBD>д<EFBFBD><EFBFBD>ʱʱ<EFBFBD><EFBFBD>
* @param line_limit {int} SMTP <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD>е<EFBFBD><EFBFBD><EFBFBD><EFBFBD>󳤶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @return {SMTP_CLIENT*} <EFBFBD><EFBFBD><EFBFBD>ӳɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>طǿ<EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>򷵻<EFBFBD> NULL
2014-11-19 00:25:21 +08:00
*/
SMTP_API SMTP_CLIENT *smtp_open(const char *addr, int conn_timeout,
int rw_timeout, int line_limit);
/**
* <EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD> smtp_open <EFBFBD>򿪵<EFBFBD> SMTP <EFBFBD><EFBFBD><EFBFBD>Ӳ<EFBFBD><EFBFBD>ͷŶ<EFBFBD><EFBFBD><EFBFBD>
* @param client {SMTP_CLIENT*} SMTP <EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
*/
SMTP_API void smtp_close(SMTP_CLIENT *client);
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> SMTP <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD>ӭ<EFBFBD><EFBFBD>Ϣ
* @param client {SMTP_CLIENT*} SMTP <EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
* @return {int} 0 <EFBFBD><EFBFBD>ʾ<EFBFBD>ɹ<EFBFBD>(SMTP_CLIENT::smtp_code <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* SMTP_CLIENT::buf <EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ùر<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
*/
SMTP_API int smtp_get_banner(SMTP_CLIENT *client);
/**
* <EFBFBD><EFBFBD> SMTP <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> HELO/EHLO <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param client {SMTP_CLIENT*} SMTP <EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
* @param name {const char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param ehlo {int} <EFBFBD><EFBFBD> 0 ʱʹ<EFBFBD><EFBFBD> EHLO<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD> HELO
* @return {int} 0 <EFBFBD><EFBFBD>ʾ<EFBFBD>ɹ<EFBFBD>(SMTP_CLIENT::smtp_code <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* SMTP_CLIENT::buf <EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ùر<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
*/
SMTP_API int smtp_greet(SMTP_CLIENT *client, const char* name, int ehlo);
/**
* <EFBFBD><EFBFBD> SMTP <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> HELO <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param client {SMTP_CLIENT*} SMTP <EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
* @param helo {const char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @return {int} 0 <EFBFBD><EFBFBD>ʾ<EFBFBD>ɹ<EFBFBD>(SMTP_CLIENT::smtp_code <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* SMTP_CLIENT::buf <EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ùر<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
*/
SMTP_API int smtp_helo(SMTP_CLIENT *client, const char *helo);
/**
* <EFBFBD><EFBFBD> SMTP <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> EHLO <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param client {SMTP_CLIENT*} SMTP <EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
* @param ehlo {const char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @return {int} 0 <EFBFBD><EFBFBD>ʾ<EFBFBD>ɹ<EFBFBD>(SMTP_CLIENT::smtp_code <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* SMTP_CLIENT::buf <EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ùر<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
*/
SMTP_API int smtp_ehlo(SMTP_CLIENT *client, const char *ehlo);
/**
* <EFBFBD><EFBFBD> SMTP <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD>Ϣ
* @param client {SMTP_CLIENT*} SMTP <EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
* @param user {const char*} SMTP <EFBFBD>ʼ<EFBFBD><EFBFBD>˺<EFBFBD>
* @param pass {const char*} SMTP <EFBFBD>ʼ<EFBFBD><EFBFBD>˺<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @return {int} 0 <EFBFBD><EFBFBD>ʾ<EFBFBD>ɹ<EFBFBD>(SMTP_CLIENT::smtp_code <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* SMTP_CLIENT::buf <EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ùر<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
*/
SMTP_API int smtp_auth(SMTP_CLIENT *client, const char *user, const char *pass);
/**
* <EFBFBD><EFBFBD> SMTP <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> MAIL FROM <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param client {SMTP_CLIENT*} SMTP <EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
* @param from {const char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @return {int} 0 <EFBFBD><EFBFBD>ʾ<EFBFBD>ɹ<EFBFBD>(SMTP_CLIENT::smtp_code <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* SMTP_CLIENT::buf <EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ùر<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
*/
SMTP_API int smtp_mail(SMTP_CLIENT *client, const char *from);
/**
* <EFBFBD><EFBFBD> SMTP <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> RCPT TO <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param client {SMTP_CLIENT*} SMTP <EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
* @param to {const char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @return {int} 0 <EFBFBD><EFBFBD>ʾ<EFBFBD>ɹ<EFBFBD>(SMTP_CLIENT::smtp_code <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* SMTP_CLIENT::buf <EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ùر<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
*/
SMTP_API int smtp_rcpt(SMTP_CLIENT *client, const char *to);
/**
* <EFBFBD><EFBFBD> SMTP <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> DATA <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param client {SMTP_CLIENT*} SMTP <EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
* @return {int} 0 <EFBFBD><EFBFBD>ʾ<EFBFBD>ɹ<EFBFBD>(SMTP_CLIENT::smtp_code <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* SMTP_CLIENT::buf <EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ùر<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
*/
SMTP_API int smtp_data(SMTP_CLIENT *client);
/**
* <EFBFBD><EFBFBD> SMTP <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param client {SMTP_CLIENT*} SMTP <EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
* @param src {const char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD> MIME <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param len {size_t} src <EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><EFBFBD><EFBFBD>
* @return {int} 0 <EFBFBD><EFBFBD>ʾ<EFBFBD>ɹ<EFBFBD>(SMTP_CLIENT::smtp_code <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* SMTP_CLIENT::buf <EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ùر<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
*/
SMTP_API int smtp_send(SMTP_CLIENT *client, const char* src, size_t len);
/**
* <EFBFBD><EFBFBD> SMTP <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param client {SMTP_CLIENT*} SMTP <EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
* @param fmt {const char*} <EFBFBD><EFBFBD>ʽ<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>
* @param ... <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @return {int} 0 <EFBFBD><EFBFBD>ʾ<EFBFBD>ɹ<EFBFBD>(SMTP_CLIENT::smtp_code <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* SMTP_CLIENT::buf <EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ùر<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
*/
SMTP_API int smtp_printf(SMTP_CLIENT *client, const char* fmt, ...);
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SMTP <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param client {SMTP_CLIENT*} SMTP <EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
* @return {int} 0 <EFBFBD><EFBFBD>ʾ<EFBFBD>ɹ<EFBFBD>(SMTP_CLIENT::smtp_code <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* SMTP_CLIENT::buf <EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ùر<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
*/
SMTP_API int smtp_data_end(SMTP_CLIENT *client);
/**
* <EFBFBD><EFBFBD> SMTP <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>ļ<EFBFBD>
* @param client {SMTP_CLIENT*} SMTP <EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
* @param filepath {const char*} <EFBFBD>ʼ<EFBFBD><EFBFBD>ļ<EFBFBD>·<EFBFBD><EFBFBD>
* @return {int} 0 <EFBFBD><EFBFBD>ʾ<EFBFBD>ɹ<EFBFBD>(SMTP_CLIENT::smtp_code <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* SMTP_CLIENT::buf <EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ùر<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
*/
SMTP_API int smtp_send_file(SMTP_CLIENT *client, const char *filepath);
/**
* <EFBFBD><EFBFBD> SMTP <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͸<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param client {SMTP_CLIENT*} SMTP <EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
2019-09-20 21:54:02 +08:00
* @param in {ACL_VSTREAM*} <EFBFBD>ʼ<EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @return {int} 0 <EFBFBD><EFBFBD>ʾ<EFBFBD>ɹ<EFBFBD>(SMTP_CLIENT::smtp_code <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* SMTP_CLIENT::buf <EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ùر<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
*/
SMTP_API int smtp_send_stream(SMTP_CLIENT *client, ACL_VSTREAM *in);
/**
* <EFBFBD><EFBFBD> SMTP <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD>(QUIT)<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param client {SMTP_CLIENT*} SMTP <EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
* @return {int} 0 <EFBFBD><EFBFBD>ʾ<EFBFBD>ɹ<EFBFBD>(SMTP_CLIENT::smtp_code <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* SMTP_CLIENT::buf <EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ùر<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
*/
SMTP_API int smtp_quit(SMTP_CLIENT *client);
/**
* <EFBFBD><EFBFBD> SMTP <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> NOOP <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param client {SMTP_CLIENT*} SMTP <EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
* @return {int} 0 <EFBFBD><EFBFBD>ʾ<EFBFBD>ɹ<EFBFBD>(SMTP_CLIENT::smtp_code <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* SMTP_CLIENT::buf <EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ùر<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
*/
SMTP_API int smtp_noop(SMTP_CLIENT *client);
/**
* <EFBFBD><EFBFBD> SMTP <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> RSET <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param client {SMTP_CLIENT*} SMTP <EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
* @return {int} 0 <EFBFBD><EFBFBD>ʾ<EFBFBD>ɹ<EFBFBD>(SMTP_CLIENT::smtp_code <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* SMTP_CLIENT::buf <EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ùر<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
2014-11-19 00:25:21 +08:00
*/
SMTP_API int smtp_rset(SMTP_CLIENT *client);
#ifdef __cplusplus
}
#endif
#endif