join 1.0
lightweight network framework library
Loading...
Searching...
No Matches
join::BasicSmtpSecureClient< Protocol > Class Template Reference

Basic SMTPS client. More...

#include <smtpclient.hpp>

Inheritance diagram for join::BasicSmtpSecureClient< Protocol >:
Collaboration diagram for join::BasicSmtpSecureClient< Protocol >:

Public Types

using Endpoint = typename Protocol::Endpoint
 
- Public Types inherited from join::BasicSmtpClient< Protocol >
using Endpoint = typename Protocol::Endpoint
 
using Stream = typename Protocol::Stream
 

Public Member Functions

 BasicSmtpSecureClient (const char *host, uint16_t port=465)
 create the basic SMTPS client instance.
 
 BasicSmtpSecureClient (const std::string &host, uint16_t port=465)
 create the basic SMTPS client instance.
 
 BasicSmtpSecureClient (const BasicSmtpSecureClient &other)=delete
 create the basic SMTPS client instance by copy.
 
BasicSmtpSecureClientoperator= (const BasicSmtpSecureClient &other)=delete
 assign the basic SMTPS client instance by copy.
 
 BasicSmtpSecureClient (BasicSmtpSecureClient &&other)
 create the basic SMTPS client instance by move.
 
BasicSmtpSecureClientoperator= (BasicSmtpSecureClient &&other)
 assign the basic SMTPS client instance by move.
 
virtual ~BasicSmtpSecureClient ()=default
 destroy the basic SMTPS client instance.
 
std::string scheme () const override
 get scheme.
 
- Public Member Functions inherited from join::BasicSmtpClient< Protocol >
 BasicSmtpClient (const char *host, uint16_t port=25)
 create the basic SMTP client instance.
 
 BasicSmtpClient (const std::string &host, uint16_t port=25)
 create the basic SMTP client instance.
 
 BasicSmtpClient (const BasicSmtpClient &other)=delete
 create the basic SMTP client instance by copy.
 
BasicSmtpClientoperator= (const BasicSmtpClient &other)=delete
 assign the basic SMTP client instance by copy.
 
 BasicSmtpClient (BasicSmtpClient &&other)
 create the basic SMTP client instance by move.
 
BasicSmtpClientoperator= (BasicSmtpClient &&other)
 assign the basic SMTP client instance by move.
 
virtual ~BasicSmtpClient ()=default
 destroy the basic SMTP client instance.
 
const std::string & host () const
 get host.
 
uint16_t port () const
 get port.
 
std::string authority () const
 get authority.
 
std::string url () const
 get URL.
 
void credentials (const std::string &login, const std::string &password)
 set credentials.
 
int setCertificate (const std::string &cert, const std::string &key="")
 set the certificate and the private key.
 
int setCaPath (const std::string &caPath)
 set the location of the trusted CA certificates.
 
int setCaFile (const std::string &caFile)
 set the location of the trusted CA certificate file.
 
void setVerify (bool verify, int depth=-1)
 Enable/Disable the verification of the peer certificate.
 
int setCipher (const std::string &cipher)
 set the cipher list (TLSv1.2 and below).
 
int setCipher_1_3 (const std::string &cipher)
 set the cipher list (TLSv1.3).
 
int send (const MailMessage &mail)
 send mail message.
 

Protected Member Functions

int connect (const Endpoint &endpoint) override
 make a connection to the given endpoint.
 
- Protected Member Functions inherited from join::BasicSmtpClient< Protocol >
void close ()
 close the connection.
 
int sendMessage (const std::string &message)
 send message.
 
std::string readReplies (std::vector< std::string > *replies=nullptr)
 read replies.
 
int greeting ()
 handle greeting.
 
int initialize (std::vector< std::string > &replies)
 client init.
 
int startTls ()
 start encryption.
 
int loginAuthenticate ()
 authenticate using LOGIN.
 
int plainAuthenticate ()
 authenticate using PLAIN.
 
int sendFrom (const MailMessage &message)
 send sender address.
 
int sendTo (const MailMessage &message)
 send recpient address.
 
int sendData (const MailMessage &message)
 send message.
 
int quit ()
 send quit.
 
std::string hostname () const
 get host name.
 

Additional Inherited Members

- Protected Attributes inherited from join::BasicSmtpClient< Protocol >
Stream _stream
 stream.
 
std::string _host
 SMTP host.
 
uint16_t _port
 SMTP port.
 
std::string _login
 SMTP login.
 
std::string _password
 SMTP password.
 

Detailed Description

template<class Protocol>
class join::BasicSmtpSecureClient< Protocol >

Basic SMTPS client.

Member Typedef Documentation

◆ Endpoint

template<class Protocol >
using join::BasicSmtpSecureClient< Protocol >::Endpoint = typename Protocol::Endpoint

Constructor & Destructor Documentation

◆ BasicSmtpSecureClient() [1/4]

template<class Protocol >
join::BasicSmtpSecureClient< Protocol >::BasicSmtpSecureClient ( const char * host,
uint16_t port = 465 )
inline

create the basic SMTPS client instance.

Parameters
hosthost.
portport (default: 465).

◆ BasicSmtpSecureClient() [2/4]

template<class Protocol >
join::BasicSmtpSecureClient< Protocol >::BasicSmtpSecureClient ( const std::string & host,
uint16_t port = 465 )
inline

create the basic SMTPS client instance.

Parameters
hosthost.
portport (default: 465).

◆ BasicSmtpSecureClient() [3/4]

template<class Protocol >
join::BasicSmtpSecureClient< Protocol >::BasicSmtpSecureClient ( const BasicSmtpSecureClient< Protocol > & other)
delete

create the basic SMTPS client instance by copy.

Parameters
otherrequest to copy.

◆ BasicSmtpSecureClient() [4/4]

template<class Protocol >
join::BasicSmtpSecureClient< Protocol >::BasicSmtpSecureClient ( BasicSmtpSecureClient< Protocol > && other)
inline

create the basic SMTPS client instance by move.

Parameters
otherrequest to move.

◆ ~BasicSmtpSecureClient()

template<class Protocol >
virtual join::BasicSmtpSecureClient< Protocol >::~BasicSmtpSecureClient ( )
virtualdefault

destroy the basic SMTPS client instance.

Member Function Documentation

◆ connect()

template<class Protocol >
int join::BasicSmtpSecureClient< Protocol >::connect ( const Endpoint & endpoint)
inlineoverrideprotectedvirtual

make a connection to the given endpoint.

Parameters
endpointendpoint to connect to.
Returns
0 on success, -1 on failure.

Reimplemented from join::BasicSmtpClient< Protocol >.

◆ operator=() [1/2]

template<class Protocol >
BasicSmtpSecureClient & join::BasicSmtpSecureClient< Protocol >::operator= ( BasicSmtpSecureClient< Protocol > && other)
inline

assign the basic SMTPS client instance by move.

Parameters
otherrequest to move.
Returns
a reference of the current object.

◆ operator=() [2/2]

template<class Protocol >
BasicSmtpSecureClient & join::BasicSmtpSecureClient< Protocol >::operator= ( const BasicSmtpSecureClient< Protocol > & other)
delete

assign the basic SMTPS client instance by copy.

Parameters
otherrequest to copy.
Returns
a reference of the current object.

◆ scheme()

template<class Protocol >
std::string join::BasicSmtpSecureClient< Protocol >::scheme ( ) const
inlineoverridevirtual

get scheme.

Returns
scheme.

Reimplemented from join::BasicSmtpClient< Protocol >.


The documentation for this class was generated from the following files: