Library: NetSSL_OpenSSL
Package: Mail
Header: Poco/Net/SecureSMTPClientSession.h
This class implements an Simple Mail Transfer Procotol (SMTP, RFC 2821) client for sending e-mail messages that supports the STARTTLS command for secure connections.
Usage is as follows:
Direct Base Classes: SMTPClientSession
All Base Classes: SMTPClientSession
Member Functions: startTLS
Inherited Functions: close, getTimeout, isPermanentNegative, isPositiveCompletion, isPositiveIntermediate, isTransientNegative, login, loginUsingCRAM, loginUsingCRAMMD5, loginUsingCRAMSHA1, loginUsingLogin, loginUsingPlain, open, sendCommand, sendMessage, setTimeout, socket
explicit SecureSMTPClientSession(
const StreamSocket & socket
);
Creates the SecureSMTPClientSession using the given socket, which must be connected to a SMTP server.
SecureSMTPClientSession(
const std::string & host,
Poco::UInt16 port = SMTP_PORT
);
Creates the SecureSMTPClientSession using a socket connected to the given host and port.
virtual ~SecureSMTPClientSession();
Destroys the SMTPClientSession.
bool startTLS();
Sends a STARTTLS command and, if successful, creates a secure SSL/TLS connection over the existing socket connection.
Must be called after login() or login(hostname). If successful, login() can be called again to authenticate the user.
Returns true if the STARTTLS command was successful, false otherwise.
bool startTLS(
Context::Ptr pContext
);
Sends a STARTTLS command and, if successful, creates a secure SSL/TLS connection over the existing socket connection.
Uses the given Context object for creating the SSL/TLS connection.
Must be called after login() or login(hostname). If successful, login() can be called again to authenticate the user.
Returns true if the STARTTLS command was successful, false otherwise.