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};
194 uint8_t codeLength{0};
206 int smtpParse(
char* data,
size_t len);
unsigned int count() const override
Definition: FIFO.h:37
Definition: MailMessage.h:32
Definition: SmtpClient.h:91
err_t onReceive(pbuf *buf) override
SmtpClient(bool autoDestroy=false)
Definition: SmtpClient.h:93
void onReadyToSendData(TcpConnectionEvent sourceEvent) override
bool connect(const Url &url)
Connects to remote URL.
void onServerError(SmtpClientCallback callback)
Callback that will be called every an error occurs.
Definition: SmtpClient.h:169
void quit()
Sends a quit command to the server and closes the TCP connection.
bool send(const String &from, const String &to, const String &subject, String &&body) noexcept
void onMessageSent(SmtpClientCallback callback)
Callback that will be called every time a message is sent successfully.
Definition: SmtpClient.h:160
size_t countPending()
Definition: SmtpClient.h:138
void sendMailHeaders(MailMessage *mail)
bool send(MailMessage *message)
Powerful method to queues a single message before it is sent later to the SMTP server.
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.
bool sendMailBody(MailMessage *mail)
SmtpState getState()
Returns the current state of the SmtpClient.
Definition: SmtpClient.h:151
MailMessage * getCurrentMessage()
Gets the current message.
The String class.
Definition: WString.h:137
Definition: TcpClient.h:46
void setTimeOut(uint16_t waitTimeOut)
Ssl::Session * getSsl()
Get a pointer to the current SSL session object.
Definition: TcpConnection.h:152
void setSslInitHandler(Ssl::Session::InitDelegate handler)
Set the SSL session initialisation callback.
Definition: TcpConnection.h:129
Class to manage URL instance.
Definition: Url.h:67
#define SMTP_ERROR_LENGTH
Definition: SmtpClient.h:43
SmtpState
Definition: SmtpClient.h:61
@ eSMTP_SendingData
Definition: SmtpClient.h:76
@ eSMTP_SendData
Definition: SmtpClient.h:75
@ eSMTP_Banner
Definition: SmtpClient.h:62
@ eSMTP_Sent
Definition: SmtpClient.h:81
@ eSMTP_SendingBody
Definition: SmtpClient.h:80
@ eSMTP_RequestingAuthChallenge
Definition: SmtpClient.h:67
@ eSMTP_SendAuthResponse
Definition: SmtpClient.h:68
@ eSMTP_Hello
Definition: SmtpClient.h:63
@ eSMTP_Ready
Definition: SmtpClient.h:70
@ eSMTP_SendingRcpt
Definition: SmtpClient.h:74
@ eSMTP_SendingAuth
Definition: SmtpClient.h:69
@ eSMTP_Quitting
Definition: SmtpClient.h:82
@ eSMTP_SendingMail
Definition: SmtpClient.h:72
@ eSMTP_SendMail
Definition: SmtpClient.h:71
@ eSMTP_StartBody
Definition: SmtpClient.h:79
@ eSMTP_SendingHeaders
Definition: SmtpClient.h:78
@ eSMTP_SendAuth
Definition: SmtpClient.h:65
@ eSMTP_SendHeader
Definition: SmtpClient.h:77
@ eSMTP_StartTLS
Definition: SmtpClient.h:64
@ eSMTP_SendRcpt
Definition: SmtpClient.h:73
@ eSMTP_Disconnect
Definition: SmtpClient.h:83
@ eSMTP_SendingAuthLogin
Definition: SmtpClient.h:66
TcpConnectionEvent
Definition: TcpConnection.h:26
Each result item contains a set of headers plus content stream.
Definition: MultipartStream.h:29