Skip to content

Commit

Permalink
Add support TCP KeepAlive for ESP32 and ESP8266.
Browse files Browse the repository at this point in the history
  • Loading branch information
mobizt committed Jun 17, 2023
1 parent e897fd7 commit 3dce722
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ In case you only want to exclude the error flash string from library, please com
### Using TCP session KeepAlive in ESP8266 and ESP32
The server connection will be probed at some intervals to maintain connection.
The TCP session KeepAlive can be enabled from executing `<SMTPSession>.keepAlive` or `<IMAPSession>.keepAlive` with providing TCP options as arguments, i.e.,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,11 @@ void setup()
* in case of lost internet connection for re-listening the mailbox.
*/
config.network_connection_handler = connectWiFi;


// You can use TCP KeepAlive for more reliable of listen (idle) operation, please read this for detail.
// https://github.com/mobizt/ESP-Mail-Client#using-tcp-session-keepalive-in-esp8266-and-esp32
// You can use keepAlive in ESP8266 core version newer than v3.1.2.
// Or you can use git version (v3.1.2) https://github.com/esp8266/Arduino
#if defined(ESP32)
imap.keepAlive(5, 5, 1);
#endif
Expand Down

0 comments on commit 3dce722

Please sign in to comment.