Go to the documentation of this file.
40 #define SMTP_QUEUE_SIZE 5
43 #define SMTP_ERROR_LENGTH 40
48 #define SMTP_CODE_SERVICE_READY 220
49 #define SMTP_CODE_BYE 221
50 #define SMTP_CODE_AUTH_OK 235
51 #define SMTP_CODE_REQUEST_OK 250
52 #define SMTP_CODE_AUTH_CHALLENGE 334
53 #define SMTP_CODE_START_DATA 354
55 #define SMTP_OPT_PIPELINE bit(0)
56 #define SMTP_OPT_STARTTLS bit(1)
57 #define SMTP_OPT_AUTH_PLAIN bit(2)
58 #define SMTP_OPT_AUTH_LOGIN bit(3)
59 #define SMTP_OPT_AUTH_CRAM_MD5 bit(4)
140 return mailQ.
count();
162 messageSentCallback = callback;
171 errorCallback = callback;
193 bool isLastLine{
false};
206 int smtpParse(
char* data,
size_t len);
@ eSMTP_SendingRcpt
Definition: SmtpClient.h:74
bool sendMailBody(MailMessage *mail)
void onReadyToSendData(TcpConnectionEvent sourceEvent) override
@ eSMTP_Banner
Definition: SmtpClient.h:62
@ eSMTP_Sent
Definition: SmtpClient.h:81
Class to manage URL instance.
Definition: Url.h:66
@ eSMTP_Hello
Definition: SmtpClient.h:63
@ eSMTP_StartBody
Definition: SmtpClient.h:79
@ eSMTP_Ready
Definition: SmtpClient.h:70
@ eSMTP_RequestingAuthChallenge
Definition: SmtpClient.h:67
@ eSMTP_Disconnect
Definition: SmtpClient.h:83
Definition: MailMessage.h:31
@ eSMTP_SendHeader
Definition: SmtpClient.h:77
The String class.
Definition: WString.h:136
TcpConnectionEvent
Definition: TcpConnection.h:26
Each result item contains a set of headers plus content stream.
Definition: MultipartStream.h:39
void setTimeOut(uint16_t waitTimeOut)
@ eSMTP_SendMail
Definition: SmtpClient.h:71
MailMessage * getCurrentMessage()
Gets the current message.
unsigned int count() const override
Definition: FIFO.h:37
SmtpClient(bool autoDestroy=false)
Definition: SmtpClient.h:93
Definition: TcpClient.h:45
@ eSMTP_SendRcpt
Definition: SmtpClient.h:73
size_t countPending()
Definition: SmtpClient.h:138
Definition: SmtpClient.h:90
Ssl::Session * getSsl()
Get a pointer to the current SSL session object.
Definition: TcpConnection.h:148
@ eSMTP_SendingData
Definition: SmtpClient.h:76
@ eSMTP_SendingBody
Definition: SmtpClient.h:80
void onMessageSent(SmtpClientCallback callback)
Callback that will be called every time a message is sent successfully.
Definition: SmtpClient.h:160
void onServerError(SmtpClientCallback callback)
Callback that will be called every an error occurs.
Definition: SmtpClient.h:169
@ eSMTP_StartTLS
Definition: SmtpClient.h:64
@ eSMTP_SendingAuth
Definition: SmtpClient.h:69
void quit()
Sends a quit command to the server and closes the TCP connection.
bool connect(const Url &url)
Connects to remote URL.
@ eSMTP_SendingAuthLogin
Definition: SmtpClient.h:66
@ eSMTP_SendAuth
Definition: SmtpClient.h:65
@ eSMTP_Quitting
Definition: SmtpClient.h:82
@ eSMTP_SendAuthResponse
Definition: SmtpClient.h:68
@ eSMTP_SendingHeaders
Definition: SmtpClient.h:78
void sendMailHeaders(MailMessage *mail)
@ eSMTP_SendingMail
Definition: SmtpClient.h:72
bool send(const String &from, const String &to, const String &subject, const String &body)
Queues a single message before it is sent later to the SMTP server.
err_t onReceive(pbuf *buf) override
SmtpState getState()
Returns the current state of the SmtpClient.
Definition: SmtpClient.h:151
SmtpState
Definition: SmtpClient.h:61
#define SMTP_ERROR_LENGTH
Definition: SmtpClient.h:43
@ eSMTP_SendData
Definition: SmtpClient.h:75
void setSslInitHandler(Ssl::Session::InitDelegate handler)
Set the SSL session initialisation callback.
Definition: TcpConnection.h:125