NetBurner 3.1
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, SharkSslCAList caList=nullptr)
 Send an email message using SSL encryption. More...
 
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, bool verifyPeer=false, SharkSslCAList caList=nullptr)
 Send an HTML email message from a file using SSL encryption. More...
 
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, SharkSslCAList caList=nullptr)
 Start a Multi-purpose Internet Mail Extension (MIME)session using SSL encryption. More...
 

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,
SharkSslCAList  caList = nullptr 
)

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 name to use for certificate name verification and when sending SNI extensions.
verifyPeerShould the client verify the server's certificate against a Certificate Authority list?
caListThe CA list associated with verifypeer.
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,
bool  verifyPeer = false,
SharkSslCAList  caList = nullptr 
)

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.
verifyPeerShould the client verify the server's certificate against a Certificate Authority list?
caListThe CA list associated with verifypeer.
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,
SharkSslCAList  caList = nullptr 
)

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.
verifyPeerShould the client verify the server's certificate against a Certificate Authority list?
caListThe CA list associated with verifypeer.
Return values
0Send failed
1Send was successful
See also
SendMailAuthStartMIME()
SendMailAuthAddMIME()
SendMailAuthEndMIME()