NetBurner 3.5.6
PDF Version
SSL SMTP Functions

Functions

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.
 

Detailed Description

The following functions is very similar to the unencrypted SendMail() function. The initial connection of the SMTP server can happen in one of two ways:

1) An SSL connection is negotiated immediately. 2) A TCP connection is opened first, and a SSL connection is negotiated when the SMTP server sends a STARTTLS command to the NetBurner device.

Setting STARTTLS = TRUE enables the second mode of operation.

Function Documentation

◆ SSL_SendMail()

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 )

#include <ssl_mailto.h>

Send an email message using SSL encryption.

Parameters
smtp_serverIP address of the SMTP server.
useridAscII String to provide for RFC931 IDentification.
passAscII String to provide for AUTH IDentification.
from_addrFrom email address.
to_addrTo email address.
subjectThe email subject.
textbodyThe email body.
STARTTLSEnable/disable STARTTLS functionality. Default is disabled.
remotePortPort number to connect to on the SMTP server.
serverNameServer common name to use for certificate name verification and when sending SNI extensions.
verifyPeerSet true to verify the server's certificate against a Certificate Authority list. Default if false.
certBuffBuffer containing the certificate data.Default is null.
certBuffSizeSize of the buffer containing the certificate data.
certBuffFormatThe format of the certificate buffer. Default is SSL_FILETYPE_PEM.
Return values
0Send failed
1Send was successful
See also
SSL_SendMailHTML()
SSL_SendMailStartMIME()
SendMail()

◆ SSL_SendMailHTML()

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 )

#include <ssl_mailto.h>

Send an HTML email message from a file using SSL encryption.

Parameters
smtp_serverIP address of the SMTP server.
useridAscii string to provide for RFC931 IDentification.
passAscii string to provide for AUTH IDentification.
from_addrFrom email address.
to_addrTo email address.
subjectThe email subject.
filenameHTTP server filename to send.
STARTTLSEnable/disable STARTTLS functionality. Default is disabled.
remotePortPort number to connect to on the SMTP server.
serverNameServer name to use for certificate name verification and when sending SNI extensions.
certBuffBuffer containing the certificate data. Default is null.
certBuffSizeSize of the buffer containing the certificate data.
certBuffFormatThe format of the certificate buffer. Default is SSL_FILETYPE_PEM.
Return values
0Send failed
1Send was successful
See also
SSL_SendMail()
SSL_SendMailStartMIME()
SendMail()

◆ SSL_SendMailStartMIME()

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 )

#include <ssl_mailto.h>

Start a Multi-purpose Internet Mail Extension (MIME)session using SSL encryption.

Sending an E-Mail message with Multipurpose Internet Mail Extensions (MIME) is a multi step process:

The following MIME types are supported by default. The binary attachment should cover most types such as jpg, gif, etc. The types are defined by MIME Content Types.

Parameters
smtp_serverIP address of the SMTP server.
useridAscii string to provide for RFC931 IDentification.
passAscii string to provide for AUTH IDentification.
from_addrFrom email address.
to_addrTo email address.
subjectThe email subject.
STARTTLSEnable/disable STARTTLS functionality. Default is disabled.
remotePortPort number to connect to on the SMTP server.
serverNameServer name to use for certificate name verification and when sending SNI extensions.
verifyPeerSet true to verify the server's certificate against a Certificate Authority list. Default if false.
certBuffBuffer containing the certificate data. Default is null.
certBuffSizeSize of the buffer containing the certificate data.
certBuffFormatThe format of the certificate buffer.
Return values
0Send failed
1Send was successful
See also
SendMailAuthStartMIME()
SendMailAuthAddMIME()
SendMailAuthEndMIME()