|
join 1.0
lightweight network framework library
|
basic SMTP client. More...
#include <smtpclient.hpp>

Public Types | |
| using | Endpoint = typename Protocol::Endpoint |
| using | Stream = typename Protocol::Stream |
Public Member Functions | |
| 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. | |
| BasicSmtpClient & | operator= (const BasicSmtpClient &other)=delete |
| assign the basic SMTP client instance by copy. | |
| BasicSmtpClient (BasicSmtpClient &&other) | |
| create the basic SMTP client instance by move. | |
| BasicSmtpClient & | operator= (BasicSmtpClient &&other) |
| assign the basic SMTP client instance by move. | |
| virtual | ~BasicSmtpClient ()=default |
| destroy the basic SMTP client instance. | |
| virtual std::string | scheme () const |
| get scheme. | |
| 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 | |
| virtual int | connect (const Endpoint &endpoint) |
| make a connection to the given endpoint. | |
| 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. | |
Protected Attributes | |
| Stream | _stream |
| stream. | |
| std::string | _host |
| SMTP host. | |
| uint16_t | _port |
| SMTP port. | |
| std::string | _login |
| SMTP login. | |
| std::string | _password |
| SMTP password. | |
basic SMTP client.
| using join::BasicSmtpClient< Protocol >::Endpoint = typename Protocol::Endpoint |
| using join::BasicSmtpClient< Protocol >::Stream = typename Protocol::Stream |
|
inline |
create the basic SMTP client instance.
| host | host. |
| port | port (default: 25). |
|
inline |
create the basic SMTP client instance.
| host | host. |
| port | port (default: 25). |
|
delete |
create the basic SMTP client instance by copy.
| other | request to copy. |
|
inline |
create the basic SMTP client instance by move.
| other | request to move. |
|
virtualdefault |
destroy the basic SMTP client instance.
|
inline |
get authority.
|
inlineprotected |
close the connection.
|
inlineprotectedvirtual |
make a connection to the given endpoint.
| endpoint | endpoint to connect to. |
Reimplemented in join::BasicSmtpSecureClient< Protocol >.
|
inline |
set credentials.
| login | login. |
| password | password. |
|
inlineprotected |
handle greeting.
|
inline |
get host.
|
inlineprotected |
get host name.
|
inlineprotected |
client init.
| replies | server replies. |
|
inlineprotected |
authenticate using LOGIN.
|
inline |
assign the basic SMTP client instance by move.
| other | request to move. |
|
delete |
assign the basic SMTP client instance by copy.
| other | request to copy. |
|
inlineprotected |
authenticate using PLAIN.
|
inline |
get port.
|
inlineprotected |
send quit.
|
inlineprotected |
read replies.
| replies | replies to read. |
|
inlinevirtual |
|
inline |
send mail message.
| mail message to send. |
|
inlineprotected |
send message.
| message | message to send. |
|
inlineprotected |
send sender address.
| message | mail message. |
|
inlineprotected |
send message.
| message | message to send. |
|
inlineprotected |
send recpient address.
| message | mail message. |
|
inline |
set the location of the trusted CA certificate file.
| caFile | path of the trusted CA certificate file. |
|
inline |
set the location of the trusted CA certificates.
| caPath | path of the trusted CA certificates. |
|
inline |
set the certificate and the private key.
| cert | certificate path. |
| key | private key path. |
|
inline |
set the cipher list (TLSv1.2 and below).
| cipher | the cipher list. |
|
inline |
set the cipher list (TLSv1.3).
| cipher | the cipher list. |
|
inline |
Enable/Disable the verification of the peer certificate.
| verify | Enable peer verification if set to true, false otherwise. |
| depth | The maximum certificate verification depth (default: no limit). |
|
inlineprotected |
start encryption.
|
inline |
get URL.
|
protected |
SMTP host.
|
protected |
SMTP login.
|
protected |
SMTP password.
|
protected |
SMTP port.
|
protected |
stream.