Provides SMTP/S client.
More...
|
#define | SMTP_QUEUE_SIZE 5 |
|
#define | SMTP_ERROR_LENGTH 40 |
|
#define | SMTP_CODE_SERVICE_READY 220 |
|
#define | SMTP_CODE_BYE 221 |
|
#define | SMTP_CODE_AUTH_OK 235 |
|
#define | SMTP_CODE_REQUEST_OK 250 |
|
#define | SMTP_CODE_AUTH_CHALLENGE 334 |
|
#define | SMTP_CODE_START_DATA 354 |
|
#define | SMTP_OPT_PIPELINE bit(0) |
|
#define | SMTP_OPT_STARTTLS bit(1) |
|
#define | SMTP_OPT_AUTH_PLAIN bit(2) |
|
#define | SMTP_OPT_AUTH_LOGIN bit(3) |
|
#define | SMTP_OPT_AUTH_CRAM_MD5 bit(4) |
|
|
typedef std::function< int(SmtpClient &client, int code, char *status)> | SmtpClientCallback |
|
|
enum | SmtpState {
eSMTP_Banner = 0,
eSMTP_Hello,
eSMTP_StartTLS,
eSMTP_SendAuth,
eSMTP_SendingAuthLogin,
eSMTP_RequestingAuthChallenge,
eSMTP_SendAuthResponse,
eSMTP_SendingAuth,
eSMTP_Ready,
eSMTP_SendMail,
eSMTP_SendingMail,
eSMTP_SendRcpt,
eSMTP_SendingRcpt,
eSMTP_SendData,
eSMTP_SendingData,
eSMTP_SendHeader,
eSMTP_SendingHeaders,
eSMTP_StartBody,
eSMTP_SendingBody,
eSMTP_Sent,
eSMTP_Quitting,
eSMTP_Disconnect
} |
|
Provides SMTP/S client.
#define SMTP_CODE_SERVICE_READY 220 |
bool SmtpClient::connect |
( |
const Url & |
url | ) |
|
Connects to remote URL.
- Parameters
-
URL | - provides the protocol, remote server, port and user credentials allowed protocols:
- smtp - clear text SMTP
- smtps - SMTP over SSL connection
|
Gets the current message.
- Returns
- MailMessage* message - the message, or NULL if none is scheduled
SmtpState SmtpClient::getState |
( |
| ) |
|
|
inline |
void SmtpClient::onMessageSent |
( |
SmtpClientCallback |
callback | ) |
|
|
inline |
Callback that will be called every time a message is sent successfully.
- Parameters
-
SmtpClientCallback | callback |
void SmtpClient::onServerError |
( |
SmtpClientCallback |
callback | ) |
|
|
inline |
Callback that will be called every an error occurs.
- Parameters
-
SmtpClientCallback | callback |
void SmtpClient::quit |
( |
| ) |
|
Sends a quit command to the server and closes the TCP conneciton.
Queues a single message before it is sent later to the SMTP server.
- Parameters
-
String& | from |
String& | to |
String& | subject |
String& | body the body in plain text format |
- Returns
- true when the message was queued successfully, false otherwise
Powerful method to queues a single message before it is sent later to the SMTP server.
- Parameters
-
- Returns
- true when the message was queued successfully, false otherwise