Skip to content
This repository has been archived by the owner on Jan 10, 2021. It is now read-only.

Commit

Permalink
Fix share http client issue for IMAP and SMTP
Browse files Browse the repository at this point in the history
  • Loading branch information
mobizt committed Jul 26, 2019
1 parent 4ccc8f4 commit b88ff3b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Mail Client Arduino Library for ESP32 v 1.1.5
# Mail Client Arduino Library for ESP32 v 1.1.6

This library allows ESP32 to send Email with/without attachment and receive Email with/without attachment download via SMTP and IMAP servers.

Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name=ESP32 Mail Client

version=1.1.5
version=1.1.6

author=Mobizt

Expand Down
10 changes: 5 additions & 5 deletions src/ESP32_MailClient.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
*Mail Client Arduino Library for ESP32, version 1.1.5
*Mail Client Arduino Library for ESP32, version 1.1.6
*
* July 26, 2019
*
Expand Down Expand Up @@ -122,9 +122,11 @@ bool ESP32_MailClient::readMail(HTTPClientESP32Ex &http, IMAPData &imapData)
imapData._readCallback(imapData._cbData);
}

while (!http.http_connect() && count < 10)
http.http_begin(imapData._host.c_str(), imapData._port, ESP32_MAIL_STR_202, (const char *)NULL);

while (!http.http_connected() && count < 10)
{
http.http_begin(imapData._host.c_str(), imapData._port, ESP32_MAIL_STR_202, (const char *)NULL);

count++;

if (!http.http_connect())
Expand Down Expand Up @@ -778,8 +780,6 @@ bool ESP32_MailClient::readMail(HTTPClientESP32Ex &http, IMAPData &imapData)
imapData._readCallback(imapData._cbData);
}

log_out:

if (http.http_connected())
while (client->available())
client->read();
Expand Down
2 changes: 1 addition & 1 deletion src/ESP32_MailClient.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
*Mail Client Arduino Library for ESP32, version 1.1.5
*Mail Client Arduino Library for ESP32, version 1.1.6
*
* June 26, 2019
*
Expand Down

0 comments on commit b88ff3b

Please sign in to comment.