NetBurner 3.5.6
PDF Version
ssl_mailto.h
Go to the documentation of this file.
1/*NB_REVISION*/
2
3/*NB_COPYRIGHT*/
4
27#ifndef _NB_SSL_MAILTO
28#define _NB_SSL_MAILTO
29
30#include <predef.h>
31#ifdef NB_SSL_SUPPORTED
32
33#include <mailto.h>
34#include <crypto/ssl.h>
35
61int SSL_SendMail(IPADDR smtp_server,
62 PCSTR userid,
63 PCSTR pass,
64 PCSTR from_addr,
65 PCSTR to_addr,
66 PCSTR subject,
67 PCSTR textbody,
68 BOOL STARTTLS = false,
69 int remotePort = -1,
70 const char *serverName = nullptr,
71 bool verifyPeer = false,
72 const unsigned char *certBuff = nullptr,
73 uint32_t certBuffSize = 0,
74 uint16_t certBuffFormat = SSL_FILETYPE_PEM);
75
100int SSL_SendMailHTML(IPADDR smtp_server,
101 PCSTR userid,
102 PCSTR pass,
103 PCSTR from_addr,
104 PCSTR to_addr,
105 PCSTR subject,
106 const char *filename,
107 BOOL STARTTLS = false,
108 int remotePort = -1,
109 const char *serverName = nullptr,
110 const unsigned char *certBuff = nullptr,
111 uint32_t certBuffSize = 0,
112 uint16_t certBuffFormat = SSL_FILETYPE_PEM);
113
146int SSL_SendMailStartMIME(IPADDR smtp_server, /* IP address of the SMTP server */
147 PCSTR userid, /* AscII String to provide for RFC931 IDentification */
148 PCSTR pass, /* AscII String to provide for AUTH IDentification */
149 PCSTR from_addr, /* From E-Mail address */
150 PCSTR to_addr, /* To E-Mail Address */
151 PCSTR subject, /* E-Mail subject */
152 BOOL STARTTLS = false,
153 int remotePort = -1,
154 const char *serverName = nullptr,
155 bool verifyPeer = false,
156 const unsigned char *certBuff = nullptr,
157 uint32_t certBuffSize = 0,
158 uint16_t certBuffFormat = SSL_FILETYPE_PEM);
159
160extern uint16_t SMTP_PORT; // default is 25
161extern uint16_t RFC931_PORT; // default is 113
162extern uint16_t LOCAL_MAIL_PORT; // default is 0 to enable selection of random port number
163
164/*-------------------------------------------------------------------
165 * The following functions, variables and definitions are used for
166 * error reporting of the mail system.
167 * -----------------------------------------------------------------*/
168
169// Returns 0 or error code
170extern int NB_Mail_Error_Code;
171
172// Last error string reported by NetBurner mail library. This is usually
173// displayed on the debug serial port.
174extern char NB_Mail_Error_String[];
175
176// Last error string received from mail server
177extern char Server_Mail_Log_String[];
178
179/*
180 * SMTP Error Codes
181 * Previously defined in mailto.h
182 */
183#define STATUS_OK (0)
184#define CONNECT_TO_SMTP_SERVER_FAILED (-1)
185#define INITIAL_SERVER_REPLY_FAILED (-2)
186#define HELO_SERVER_REPLY_FAILED (-3)
187#define MAIL_FROM_SERVER_REPLY_FAILED (-4)
188#define RCPT_TO_SERVER_REPLY_FAILED (-5)
189#define DATA_SERVER_REPLY_FAILED (-6)
190#define DATA_END_SERVER_REPLY_FAILED (-7)
191#define AUTH_LOGIN_SERVER_REPLY_FAILED (-8)
192#define USER_ID_SERVER_REPLY_FAILED (-9)
193#define PASSWORD_SERVER_REPLY_FAILED (-10)
194#define CONNECT931_SMTP_SERVER_FAILED (-11)
195#define STARTTLS_SERVER_REPLY_FAILED (-12)
196
197#endif /* NB_SSL_SUPPORTED */
198
199#endif
200
Used to hold and manipulate IPv4 and IPv6 addresses in dual stack mode.
Definition ipv6_addr.h:41
int SSL_SendMail(IPADDR smtp_server, PCSTR userid, PCSTR pass, PCSTR from_addr, PCSTR to_addr, PCSTR subject, PCSTR textbody, BOOL STARTTLS=false, int remotePort=-1, const char *serverName=nullptr, bool verifyPeer=false, const unsigned char *certBuff=nullptr, uint32_t certBuffSize=0, uint16_t certBuffFormat=SSL_FILETYPE_PEM)
Send an email message using SSL encryption.
int SSL_SendMailHTML(IPADDR smtp_server, PCSTR userid, PCSTR pass, PCSTR from_addr, PCSTR to_addr, PCSTR subject, const char *filename, BOOL STARTTLS=false, int remotePort=-1, const char *serverName=nullptr, const unsigned char *certBuff=nullptr, uint32_t certBuffSize=0, uint16_t certBuffFormat=SSL_FILETYPE_PEM)
Send an HTML email message from a file using SSL encryption.
int SSL_SendMailStartMIME(IPADDR smtp_server, PCSTR userid, PCSTR pass, PCSTR from_addr, PCSTR to_addr, PCSTR subject, BOOL STARTTLS=false, int remotePort=-1, const char *serverName=nullptr, bool verifyPeer=false, const unsigned char *certBuff=nullptr, uint32_t certBuffSize=0, uint16_t certBuffFormat=SSL_FILETYPE_PEM)
Start a Multi-purpose Internet Mail Extension (MIME)session using SSL encryption.
Send Emails with SMTP.
NetBurner SSL/TLS API.