├── resources
├── images
│ ├── lan8720_modified_board.png
│ ├── lan8720_modified_schematic.png
│ ├── logo.svg
│ └── stm32_w5500.svg
└── docs
│ ├── TROUBLESHOOTING.md
│ └── ADVANCED.md
├── library.properties
├── library.json
├── .github
├── FUNDING.yml
├── stale.yml
├── workflows
│ ├── cpp_lint.yml
│ └── jekyll-gh-pages.yml
└── ISSUE_TEMPLATE
│ ├── feature_request.md
│ └── bug_report.md
├── src
├── imap
│ ├── MailboxInfo.h
│ ├── IMAPResponse.h
│ └── IMAPBase.h
├── core
│ ├── ReadyError.h
│ ├── ReadyTimer.h
│ ├── ReadyClient.h
│ ├── Utils.h
│ └── QBDecoder.h
├── ReadyMail.h
└── smtp
│ └── SMTPResponse.h
├── examples
├── Reading
│ ├── OTA
│ │ ├── Networks.h
│ │ └── OTA.ino
│ ├── Append
│ │ └── Networks.h
│ ├── Command
│ │ ├── Networks.h
│ │ └── Command.ino
│ ├── Download
│ │ ├── Networks.h
│ │ └── Download.ino
│ ├── Fetch
│ │ ├── Networks.h
│ │ └── Fetch.ino
│ ├── Idling
│ │ ├── Networks.h
│ │ └── Idling.ino
│ ├── Search
│ │ ├── Networks.h
│ │ └── Search.ino
│ └── FetchAsync
│ │ ├── Networks.h
│ │ └── FetchAsync.ino
├── Network
│ ├── AutoPort
│ │ ├── Networks.h
│ │ └── AutoPort.ino
│ ├── AutoClient
│ │ ├── Networks.h
│ │ └── AutoClient.ino
│ ├── EthernetClient
│ │ └── EthernetClient.ino
│ └── GSMClient
│ │ └── GSMClient.ino
└── Sending
│ ├── Command
│ ├── Networks.h
│ └── Command.ino
│ ├── Attachment
│ ├── Networks.h
│ └── Attachment.ino
│ ├── InlineImage
│ ├── Networks.h
│ └── InlineImage.ino
│ ├── RFC822Message
│ └── Networks.h
│ ├── SendAsync
│ ├── Networks.h
│ └── SendAsync.ino
│ ├── SimpleText
│ ├── Networks.h
│ └── SimpleText.ino
│ ├── StaticText
│ ├── Networks.h
│ └── StaticText.ino
│ └── ESP32Camera
│ ├── ESP32Camera.ino
│ └── camera_pins.h
├── LICENSE
├── keywords.txt
└── README.md
/resources/images/lan8720_modified_board.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mobizt/ReadyMail/HEAD/resources/images/lan8720_modified_board.png
--------------------------------------------------------------------------------
/resources/images/lan8720_modified_schematic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mobizt/ReadyMail/HEAD/resources/images/lan8720_modified_schematic.png
--------------------------------------------------------------------------------
/resources/images/logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/library.properties:
--------------------------------------------------------------------------------
1 | name=ReadyMail
2 |
3 | version=0.3.6
4 |
5 | author=Mobizt
6 |
7 | maintainer=Mobizt
8 |
9 | sentence=The fast and lightweight async Email client library for Arduino.
10 |
11 | paragraph=This library supports sending and fetching the Email. The nested RFC822 message attachments sending and fetching are also supported.
12 |
13 | category=Communication
14 |
15 | url=https://github.com/mobizt/ReadyMail
16 |
17 | architectures=esp8266,esp32,sam,samd,stm32,STM32F1,STM32F4,teensy,mbed_nano,mbed_rp2040,rp2040, renesas_uno
18 |
--------------------------------------------------------------------------------
/library.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ReadyMail",
3 | "version": "0.3.6",
4 | "keywords": "communication, email, imap, smtp, esp32, esp8266, samd, arduino",
5 | "description": "The fast and lightweight async Email client library for Arduino.",
6 | "repository": {
7 | "type": "git",
8 | "url": "https://github.com/mobizt/ReadyMail.git"
9 | },
10 | "authors": [{
11 | "name": "Mobizt",
12 | "email": "suwatchai@outlook.com"
13 | }],
14 | "frameworks": "arduino",
15 | "platforms": "espressif32, espressif8266, atmelsam, ststm32, teensy, rp2040, renesas-ra"
16 | }
17 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: mobizt
4 | patreon: # Replace with a single Patreon username
5 | open_collective: # Replace with a single Open Collective username
6 | ko_fi: # Replace with a single Ko-fi username
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | otechie: # Replace with a single Otechie username
12 | custom:
13 | - https://www.buymeacoffee.com/Mobizt
14 |
--------------------------------------------------------------------------------
/src/imap/MailboxInfo.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2025 Suwatchai K.
3 | *
4 | * SPDX-License-Identifier: MIT
5 | */
6 |
7 | #ifndef IMAP_MAILBOX_INFO_H
8 | #define IMAP_MAILBOX_INFO_H
9 | #if defined(ENABLE_IMAP)
10 | #include
11 | #include "Common.h"
12 |
13 | namespace ReadyMailIMAP
14 | {
15 | typedef struct mailbox_info
16 | {
17 | uint32_t msgCount = 0, RecentCount = 0, UIDValidity = 0, nextUID = 0, UnseenIndex = 0, highestModseq = 0;
18 | bool noModseq = false;
19 | std::vector flags, permanentFlags;
20 | String name;
21 | } MailboxInfo;
22 | }
23 |
24 | #endif
25 | #endif
26 |
--------------------------------------------------------------------------------
/.github/stale.yml:
--------------------------------------------------------------------------------
1 | # Number of days of inactivity before an issue becomes stale
2 | daysUntilStale: 2
3 | # Number of days of inactivity before a stale issue is closed
4 | daysUntilClose: 1
5 | # Issues with these labels will never be considered stale
6 | exemptLabels:
7 | - pinned
8 | - security
9 | # Label to use when marking an issue as stale
10 | staleLabel: wontfix
11 | # Comment to post when marking an issue as stale. Set to `false` to disable
12 | markComment: >
13 | This issue has been automatically marked as stale because it has not had
14 | recent activity. It will be closed if no further activity occurs. Thank you
15 | for your contributions.
16 | # Comment to post when closing a stale issue. Set to `false` to disable
17 | closeComment: false
18 |
--------------------------------------------------------------------------------
/.github/workflows/cpp_lint.yml:
--------------------------------------------------------------------------------
1 | name: cpplint
2 |
3 | on:
4 | pull_request:
5 | paths-ignore:
6 | - '.github/workflows/compile_*.yml'
7 | jobs:
8 | build:
9 | runs-on: ubuntu-latest
10 | steps:
11 | - uses: actions/checkout@v2
12 | - name: cpplint
13 | uses: reviewdog/action-cpplint@master
14 | with:
15 | github_token: ${{ secrets.GITHUB_TOKEN }}
16 | reporter: github-pr-check
17 | flags: --linelength=100
18 | filter: "-whitespace/tab\
19 | ,-readability/braces\
20 | ,-whitespace/braces\
21 | ,-whitespace/comments\
22 | ,-whitespace/indent\
23 | ,-whitespace/newline\
24 | ,-whitespace/operators\
25 | ,-whitespace/parens\
26 | "
--------------------------------------------------------------------------------
/examples/Reading/OTA/Networks.h:
--------------------------------------------------------------------------------
1 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
2 | #include
3 | #elif defined(ESP8266)
4 | #include
5 | #elif __has_include() || defined(ARDUINO_NANO_RP2040_CONNECT)
6 | #include
7 | #elif __has_include()
8 | #include
9 | #elif __has_include() || defined(ARDUINO_UNOWIFIR4)
10 | #include
11 | #elif __has_include() || defined(ARDUINO_PORTENTA_C33)
12 | #include
13 | #elif __has_include()
14 | #include
15 | #endif
16 |
17 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ESP8266)
18 | #include
19 | #else
20 | #include
21 | #endif
--------------------------------------------------------------------------------
/examples/Network/AutoPort/Networks.h:
--------------------------------------------------------------------------------
1 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
2 | #include
3 | #elif defined(ESP8266)
4 | #include
5 | #elif __has_include() || defined(ARDUINO_NANO_RP2040_CONNECT)
6 | #include
7 | #elif __has_include()
8 | #include
9 | #elif __has_include() || defined(ARDUINO_UNOWIFIR4)
10 | #include
11 | #elif __has_include() || defined(ARDUINO_PORTENTA_C33)
12 | #include
13 | #elif __has_include()
14 | #include
15 | #endif
16 |
17 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ESP8266)
18 | #include
19 | #else
20 | #include
21 | #endif
--------------------------------------------------------------------------------
/examples/Reading/Append/Networks.h:
--------------------------------------------------------------------------------
1 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
2 | #include
3 | #elif defined(ESP8266)
4 | #include
5 | #elif __has_include() || defined(ARDUINO_NANO_RP2040_CONNECT)
6 | #include
7 | #elif __has_include()
8 | #include
9 | #elif __has_include() || defined(ARDUINO_UNOWIFIR4)
10 | #include
11 | #elif __has_include() || defined(ARDUINO_PORTENTA_C33)
12 | #include
13 | #elif __has_include()
14 | #include
15 | #endif
16 |
17 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ESP8266)
18 | #include
19 | #else
20 | #include
21 | #endif
--------------------------------------------------------------------------------
/examples/Reading/Command/Networks.h:
--------------------------------------------------------------------------------
1 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
2 | #include
3 | #elif defined(ESP8266)
4 | #include
5 | #elif __has_include() || defined(ARDUINO_NANO_RP2040_CONNECT)
6 | #include
7 | #elif __has_include()
8 | #include
9 | #elif __has_include() || defined(ARDUINO_UNOWIFIR4)
10 | #include
11 | #elif __has_include() || defined(ARDUINO_PORTENTA_C33)
12 | #include
13 | #elif __has_include()
14 | #include
15 | #endif
16 |
17 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ESP8266)
18 | #include
19 | #else
20 | #include
21 | #endif
--------------------------------------------------------------------------------
/examples/Reading/Download/Networks.h:
--------------------------------------------------------------------------------
1 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
2 | #include
3 | #elif defined(ESP8266)
4 | #include
5 | #elif __has_include() || defined(ARDUINO_NANO_RP2040_CONNECT)
6 | #include
7 | #elif __has_include()
8 | #include
9 | #elif __has_include() || defined(ARDUINO_UNOWIFIR4)
10 | #include
11 | #elif __has_include() || defined(ARDUINO_PORTENTA_C33)
12 | #include
13 | #elif __has_include()
14 | #include
15 | #endif
16 |
17 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ESP8266)
18 | #include
19 | #else
20 | #include
21 | #endif
--------------------------------------------------------------------------------
/examples/Reading/Fetch/Networks.h:
--------------------------------------------------------------------------------
1 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
2 | #include
3 | #elif defined(ESP8266)
4 | #include
5 | #elif __has_include() || defined(ARDUINO_NANO_RP2040_CONNECT)
6 | #include
7 | #elif __has_include()
8 | #include
9 | #elif __has_include() || defined(ARDUINO_UNOWIFIR4)
10 | #include
11 | #elif __has_include() || defined(ARDUINO_PORTENTA_C33)
12 | #include
13 | #elif __has_include()
14 | #include
15 | #endif
16 |
17 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ESP8266)
18 | #include
19 | #else
20 | #include
21 | #endif
--------------------------------------------------------------------------------
/examples/Reading/Idling/Networks.h:
--------------------------------------------------------------------------------
1 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
2 | #include
3 | #elif defined(ESP8266)
4 | #include
5 | #elif __has_include() || defined(ARDUINO_NANO_RP2040_CONNECT)
6 | #include
7 | #elif __has_include()
8 | #include
9 | #elif __has_include() || defined(ARDUINO_UNOWIFIR4)
10 | #include
11 | #elif __has_include() || defined(ARDUINO_PORTENTA_C33)
12 | #include
13 | #elif __has_include()
14 | #include
15 | #endif
16 |
17 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ESP8266)
18 | #include
19 | #else
20 | #include
21 | #endif
--------------------------------------------------------------------------------
/examples/Reading/Search/Networks.h:
--------------------------------------------------------------------------------
1 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
2 | #include
3 | #elif defined(ESP8266)
4 | #include
5 | #elif __has_include() || defined(ARDUINO_NANO_RP2040_CONNECT)
6 | #include
7 | #elif __has_include()
8 | #include
9 | #elif __has_include() || defined(ARDUINO_UNOWIFIR4)
10 | #include
11 | #elif __has_include() || defined(ARDUINO_PORTENTA_C33)
12 | #include
13 | #elif __has_include()
14 | #include
15 | #endif
16 |
17 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ESP8266)
18 | #include
19 | #else
20 | #include
21 | #endif
--------------------------------------------------------------------------------
/examples/Sending/Command/Networks.h:
--------------------------------------------------------------------------------
1 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
2 | #include
3 | #elif defined(ESP8266)
4 | #include
5 | #elif __has_include() || defined(ARDUINO_NANO_RP2040_CONNECT)
6 | #include
7 | #elif __has_include()
8 | #include
9 | #elif __has_include() || defined(ARDUINO_UNOWIFIR4)
10 | #include
11 | #elif __has_include() || defined(ARDUINO_PORTENTA_C33)
12 | #include
13 | #elif __has_include()
14 | #include
15 | #endif
16 |
17 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ESP8266)
18 | #include
19 | #else
20 | #include
21 | #endif
--------------------------------------------------------------------------------
/examples/Network/AutoClient/Networks.h:
--------------------------------------------------------------------------------
1 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
2 | #include
3 | #elif defined(ESP8266)
4 | #include
5 | #elif __has_include() || defined(ARDUINO_NANO_RP2040_CONNECT)
6 | #include
7 | #elif __has_include()
8 | #include
9 | #elif __has_include() || defined(ARDUINO_UNOWIFIR4)
10 | #include
11 | #elif __has_include() || defined(ARDUINO_PORTENTA_C33)
12 | #include
13 | #elif __has_include()
14 | #include
15 | #endif
16 |
17 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ESP8266)
18 | #include
19 | #else
20 | #include
21 | #endif
--------------------------------------------------------------------------------
/examples/Reading/FetchAsync/Networks.h:
--------------------------------------------------------------------------------
1 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
2 | #include
3 | #elif defined(ESP8266)
4 | #include
5 | #elif __has_include() || defined(ARDUINO_NANO_RP2040_CONNECT)
6 | #include
7 | #elif __has_include()
8 | #include
9 | #elif __has_include() || defined(ARDUINO_UNOWIFIR4)
10 | #include
11 | #elif __has_include() || defined(ARDUINO_PORTENTA_C33)
12 | #include
13 | #elif __has_include()
14 | #include
15 | #endif
16 |
17 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ESP8266)
18 | #include
19 | #else
20 | #include
21 | #endif
--------------------------------------------------------------------------------
/examples/Sending/Attachment/Networks.h:
--------------------------------------------------------------------------------
1 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
2 | #include
3 | #elif defined(ESP8266)
4 | #include
5 | #elif __has_include() || defined(ARDUINO_NANO_RP2040_CONNECT)
6 | #include
7 | #elif __has_include()
8 | #include
9 | #elif __has_include() || defined(ARDUINO_UNOWIFIR4)
10 | #include
11 | #elif __has_include() || defined(ARDUINO_PORTENTA_C33)
12 | #include
13 | #elif __has_include()
14 | #include
15 | #endif
16 |
17 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ESP8266)
18 | #include
19 | #else
20 | #include
21 | #endif
--------------------------------------------------------------------------------
/examples/Sending/InlineImage/Networks.h:
--------------------------------------------------------------------------------
1 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
2 | #include
3 | #elif defined(ESP8266)
4 | #include
5 | #elif __has_include() || defined(ARDUINO_NANO_RP2040_CONNECT)
6 | #include
7 | #elif __has_include()
8 | #include
9 | #elif __has_include() || defined(ARDUINO_UNOWIFIR4)
10 | #include
11 | #elif __has_include() || defined(ARDUINO_PORTENTA_C33)
12 | #include
13 | #elif __has_include()
14 | #include
15 | #endif
16 |
17 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ESP8266)
18 | #include
19 | #else
20 | #include
21 | #endif
--------------------------------------------------------------------------------
/examples/Sending/RFC822Message/Networks.h:
--------------------------------------------------------------------------------
1 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
2 | #include
3 | #elif defined(ESP8266)
4 | #include
5 | #elif __has_include() || defined(ARDUINO_NANO_RP2040_CONNECT)
6 | #include
7 | #elif __has_include()
8 | #include
9 | #elif __has_include() || defined(ARDUINO_UNOWIFIR4)
10 | #include
11 | #elif __has_include() || defined(ARDUINO_PORTENTA_C33)
12 | #include
13 | #elif __has_include()
14 | #include
15 | #endif
16 |
17 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ESP8266)
18 | #include
19 | #else
20 | #include
21 | #endif
--------------------------------------------------------------------------------
/examples/Sending/SendAsync/Networks.h:
--------------------------------------------------------------------------------
1 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
2 | #include
3 | #elif defined(ESP8266)
4 | #include
5 | #elif __has_include() || defined(ARDUINO_NANO_RP2040_CONNECT)
6 | #include
7 | #elif __has_include()
8 | #include
9 | #elif __has_include() || defined(ARDUINO_UNOWIFIR4)
10 | #include
11 | #elif __has_include() || defined(ARDUINO_PORTENTA_C33)
12 | #include
13 | #elif __has_include()
14 | #include
15 | #endif
16 |
17 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ESP8266)
18 | #include
19 | #else
20 | #include
21 | #endif
--------------------------------------------------------------------------------
/examples/Sending/SimpleText/Networks.h:
--------------------------------------------------------------------------------
1 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
2 | #include
3 | #elif defined(ESP8266)
4 | #include
5 | #elif __has_include() || defined(ARDUINO_NANO_RP2040_CONNECT)
6 | #include
7 | #elif __has_include()
8 | #include
9 | #elif __has_include() || defined(ARDUINO_UNOWIFIR4)
10 | #include
11 | #elif __has_include() || defined(ARDUINO_PORTENTA_C33)
12 | #include
13 | #elif __has_include()
14 | #include
15 | #endif
16 |
17 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ESP8266)
18 | #include
19 | #else
20 | #include
21 | #endif
--------------------------------------------------------------------------------
/examples/Sending/StaticText/Networks.h:
--------------------------------------------------------------------------------
1 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ARDUINO_GIGA) || defined(ARDUINO_OPTA)
2 | #include
3 | #elif defined(ESP8266)
4 | #include
5 | #elif __has_include() || defined(ARDUINO_NANO_RP2040_CONNECT)
6 | #include
7 | #elif __has_include()
8 | #include
9 | #elif __has_include() || defined(ARDUINO_UNOWIFIR4)
10 | #include
11 | #elif __has_include() || defined(ARDUINO_PORTENTA_C33)
12 | #include
13 | #elif __has_include()
14 | #include
15 | #endif
16 |
17 | #if defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) || defined(ESP8266)
18 | #include
19 | #else
20 | #include
21 | #endif
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ENHANCEMENT
5 | labels: enhancement
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Just ask something**
11 | If you have questions, use [Discussions](https://github.com/mobizt/FirebaseClient/discussions) instead.
12 |
13 | **Is your feature request related to a problem? Please describe.**
14 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
15 |
16 | **Describe the solution you'd like**
17 | A clear and concise description of what you want to happen.
18 |
19 | **Describe alternatives you've considered**
20 | A clear and concise description of any alternative solutions or features you've considered.
21 |
22 | **Additional context**
23 | Add any other context or screenshots about the feature request here.
24 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | Please make sure, you have read the library [documentation](https://github.com/mobizt/ReadyMail) thoroughly before open the issue.
11 |
12 | **Just ask something**
13 | If you have questions, use [Discussions](https://github.com/mobizt/ReadyMail/discussions) instead.
14 |
15 | **Describe the bug**
16 | A clear and concise description of what the bug is.
17 |
18 | **To Reproduce**
19 | Create minimal, clean and clear but complete code that can be reproduced the issue.
20 | The third party libraries should be removed.
21 | And post the code here.
22 |
23 |
24 | **Expected behavior**
25 | A clear and concise description of what you expected to happen.
26 |
27 | **Screenshots**
28 | If applicable, add screenshots to help explain your problem.
29 |
30 | **IDE and its version:**
31 | - Arduino, PlatformIO
32 | - Version [e.g. 3.3.4]
33 |
34 | **ESP8266 Arduino Core SDK version**
35 | - Version [e.g. 2.3.6]
36 |
37 | **Additional context**
38 | Add any other context about the problem here.
39 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2025 Suwatchai K.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/.github/workflows/jekyll-gh-pages.yml:
--------------------------------------------------------------------------------
1 | # Sample workflow for building and deploying a Jekyll site to GitHub Pages
2 | name: Deploy Jekyll with GitHub Pages dependencies preinstalled
3 |
4 | on:
5 | # Runs on pushes targeting the default branch
6 | push:
7 | branches: ["main"]
8 |
9 | # Allows you to run this workflow manually from the Actions tab
10 | workflow_dispatch:
11 |
12 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13 | permissions:
14 | contents: read
15 | pages: write
16 | id-token: write
17 |
18 | # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19 | # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20 | concurrency:
21 | group: "pages"
22 | cancel-in-progress: false
23 |
24 | jobs:
25 | # Build job
26 | build:
27 | runs-on: ubuntu-latest
28 | steps:
29 | - name: Checkout
30 | uses: actions/checkout@v4
31 | - name: Setup Pages
32 | uses: actions/configure-pages@v5
33 | - name: Build with Jekyll
34 | uses: actions/jekyll-build-pages@v1
35 | with:
36 | source: ./
37 | destination: ./_site
38 | - name: Upload artifact
39 | uses: actions/upload-pages-artifact@v3
40 |
41 | # Deployment job
42 | deploy:
43 | environment:
44 | name: github-pages
45 | url: ${{ steps.deployment.outputs.page_url }}
46 | runs-on: ubuntu-latest
47 | needs: build
48 | steps:
49 | - name: Deploy to GitHub Pages
50 | id: deployment
51 | uses: actions/deploy-pages@v4
52 |
--------------------------------------------------------------------------------
/src/core/ReadyError.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2025 Suwatchai K.
3 | *
4 | * SPDX-License-Identifier: MIT
5 | */
6 |
7 | #ifndef READY_ERROR_H
8 | #define READY_ERROR_H
9 | #include
10 |
11 | #if defined(ENABLE_IMAP) || defined(ENABLE_SMTP)
12 | #if defined(ENABLE_DEBUG) || defined(ENABLE_CORE_DEBUG)
13 | static String rd_err(int code)
14 | {
15 | String msg;
16 | switch (code)
17 | {
18 | case TCP_CLIENT_ERROR_INITIALIZE:
19 | msg = "Client is not yet initialized";
20 | break;
21 | case TCP_CLIENT_ERROR_CONNECTION:
22 | msg = "Connection failed";
23 | break;
24 | case TCP_CLIENT_ERROR_NOT_CONNECTED:
25 | msg = "Server was not yet connected";
26 | break;
27 | case TCP_CLIENT_ERROR_CONNECTION_TIMEOUT:
28 | msg = "Connection timed out, see http://bit.ly/437GkRA";
29 | break;
30 | case TCP_CLIENT_ERROR_STARTTLS:
31 | msg = "SRART TLS failed";
32 | break;
33 | case TCP_CLIENT_ERROR_TLS_HANDSHAKE:
34 | msg = "TLS handshake failed";
35 | break;
36 | case TCP_CLIENT_ERROR_SEND_DATA:
37 | msg = "Send data failed";
38 | break;
39 | case TCP_CLIENT_ERROR_READ_DATA:
40 | msg = "Read data failed";
41 | break;
42 | case AUTH_ERROR_UNAUTHENTICATE:
43 | msg = "Unauthented";
44 | break;
45 | case AUTH_ERROR_AUTHENTICATION:
46 | msg = "Authentication error";
47 | break;
48 | case AUTH_ERROR_OAUTH2_NOT_SUPPORTED:
49 | msg = "OAuth2.0 authentication was not supported";
50 | break;
51 | default:
52 | break;
53 | }
54 | return msg;
55 | }
56 | #endif
57 | #endif
58 | #endif
--------------------------------------------------------------------------------
/resources/images/stm32_w5500.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/core/ReadyTimer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2025 Suwatchai K.
3 | *
4 | * SPDX-License-Identifier: MIT
5 | */
6 |
7 | #ifndef READY_TIMER_H
8 | #define READY_TIMER_H
9 |
10 | #include
11 |
12 | #if defined(ENABLE_IMAP) || defined(ENABLE_SMTP)
13 |
14 | class ReadyTimer
15 | {
16 | private:
17 | unsigned long ts = 0, end = 0, period = 0, now = 0, ms = 0;
18 | bool enable = false;
19 | uint8_t feed_count = 0;
20 |
21 | public:
22 | explicit ReadyTimer(unsigned long sec = 60) { setInterval(sec); }
23 |
24 | ~ReadyTimer() {}
25 |
26 | void reset() { end = ts + period; }
27 |
28 | void start()
29 | {
30 | enable = true;
31 | loop();
32 | reset();
33 | }
34 |
35 | void stop() { enable = false; }
36 |
37 | void setInterval(unsigned long sec)
38 | {
39 | loop();
40 | period = sec;
41 | reset();
42 | }
43 |
44 | void feed(unsigned long sec)
45 | {
46 | feed_count++;
47 | if (sec == 0 || feed_count == 0)
48 | feed_count = 1;
49 | stop();
50 | setInterval(sec);
51 | start();
52 | }
53 |
54 | void loop()
55 | {
56 | if (enable && (unsigned long)(millis() - now) > 100)
57 | {
58 | now = millis();
59 | if (now / 1000 >= ts)
60 | {
61 | ts = now / 1000;
62 | ms = now;
63 | }
64 | else // millis overflow handling
65 | ts += (unsigned long)(now - ms) / 1000;
66 | }
67 | }
68 |
69 | unsigned long remaining() { return ready() ? 0 : end - ts; }
70 |
71 | uint8_t feedCount() const { return feed_count; }
72 |
73 | bool isRunning() const { return enable; };
74 |
75 | bool ready()
76 | {
77 | loop();
78 | return ts >= end;
79 | }
80 | };
81 | #endif
82 | #endif
--------------------------------------------------------------------------------
/keywords.txt:
--------------------------------------------------------------------------------
1 | ######################################
2 | # Syntax Coloring Map Agaligo
3 | ######################################
4 |
5 | #######################################
6 | # Classes and Structured Type (KEYWORD1)
7 | #######################################
8 |
9 | Agaligo KEYWORD1
10 | IMAPClient KEYWORD1
11 | SMTPClient KEYWORD1
12 | SMTPMessage KEYWORD1
13 | MailboxInfo KEYWORD1
14 | Attachment KEYWORD1
15 |
16 | ###############################################
17 | # Methods and Functions (KEYWORD2)
18 | ###############################################
19 |
20 | connect KEYWORD2
21 | isConnected KEYWORD2
22 | authenticate KEYWORD2
23 | fetch KEYWORD2
24 | fetchUID KEYWORD2
25 | getMailbox KEYWORD2
26 | send KEYWORD2
27 | list KEYWORD2
28 | select KEYWORD2
29 | append KEYWORD2
30 | logout KEYWORD2
31 | stop KEYWORD2
32 | close KEYWORD2
33 | loop KEYWORD2
34 | available KEYWORD2
35 | isAuthenticated KEYWORD2
36 | currentState KEYWORD2
37 | idleStatus KEYWORD2
38 | currentMessage KEYWORD2
39 | sendCommand KEYWORD2
40 | sendData KEYWORD2
41 | setStartTLS KEYWORD2
42 | commandResponse KEYWORD2
43 | addAttachment KEYWORD2
44 | addInlineImage KEYWORD2
45 | isComplete KEYWORD2
46 | getCmdResponse KEYWORD2
47 | getDateTimeString KEYWORD2
48 | base64Encode KEYWORD2
49 | plainSASLEncode KEYWORD2
50 | fileChunk KEYWORD2
51 | fileInfo KEYWORD2
52 | fileProgress KEYWORD2
53 | fileCount KEYWORD2
54 | headerCount KEYWORD2
55 | getHeader KEYWORD2
56 | messageIndex KEYWORD2
57 | messageNum KEYWORD2
58 | messageAvailable KEYWORD2
59 | messageFound KEYWORD2
60 | event KEYWORD2
61 |
62 | #######################################
63 | # Struct and Enum (KEYWORD3)
64 | #######################################
65 |
66 | imap_state KEYWORD3
67 | smtp_state KEYWORD3
68 | SMTPStatus KEYWORD3
69 | IMAPStatus KEYWORD3
70 | readymail_file_operating_mode KEYWORD3
71 | TLSHandshakeCallback KEYWORD3
72 | FileCallback KEYWORD3
73 | SMTPResponseCallback KEYWORD3
74 | SMTPCustomComandCallback KEYWORD3
75 | SMTPCommandResponse KEYWORD3
76 | IMAPCallbackData KEYWORD3
77 | IMAPDataCallback KEYWORD3
78 | IMAPCommandResponse KEYWORD3
79 | IMAPCustomComandCallback KEYWORD3
80 | IMAPResponseCallback KEYWORD3
--------------------------------------------------------------------------------
/src/core/ReadyClient.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-FileCopyrightText: 2025 Suwatchai K.
3 | *
4 | * SPDX-License-Identifier: MIT
5 | */
6 |
7 | #pragma once
8 |
9 | #ifndef READY_CLIENT_H
10 | #define READY_CLIENT_H
11 |
12 | #include
13 | #if defined(ENABLE_READYCLIENT) && defined(READYCLIENT_SSL_CLIENT)
14 |
15 | class ReadyClient
16 | {
17 | private:
18 | std::vector ports;
19 | READYCLIENT_SSL_CLIENT *ssl_client = nullptr;
20 |
21 | public:
22 | /** ReadyClient class constructor.
23 | *
24 | * @param ssl_client The SSL client to use with ReadyClient. Currently supports ESP_SSLClient and ESP32 v3.x NeteorkClientSecure
25 | */
26 | ReadyClient(READYCLIENT_SSL_CLIENT &ssl_client) { this->ssl_client = &ssl_client; }
27 |
28 | /** Add port and protocol.
29 | *
30 | * @param port The server port.
31 | * @param proto The readymail_protocol enums e.g. readymail_protocol_plain_text, readymail_protocol_ssl and readymail_protocol_tls.
32 | * The readymail_protocol_tls is the STARTTLS protocols
33 | */
34 | void addPort(uint16_t port, readymail_protocol proto)
35 | {
36 | readymail_port_function port_func;
37 | port_func.port = port;
38 | port_func.protocol = proto;
39 | ports.push_back(port_func);
40 | }
41 | /** Clear all ports.
42 | *
43 | */
44 | void clearPorts() { ports.clear(); }
45 | ~ReadyClient() {}
46 |
47 | // Internal used functions.
48 | READYCLIENT_SSL_CLIENT &getClient() { return *ssl_client; }
49 |
50 | // Internal used functions.
51 | void configPort(uint16_t port, bool &ssl, bool &startTLS)
52 | {
53 | for (size_t i = 0; i < ports.size(); i++)
54 | {
55 | if (port == ports[i].port)
56 | {
57 | ssl = !ports[i].protocol == readymail_protocol_plain_text ? true : false;
58 | #if defined(READYCLIENT_TYPE_1)
59 | ssl_client->enableSSL(ports[i].protocol == readymail_protocol_ssl);
60 | #elif defined(READYCLIENT_TYPE_2)
61 | if (ports[i].protocol == readymail_protocol_plain_text || ports[i].protocol == readymail_protocol_tls)
62 | ssl_client->setPlainStart();
63 | #endif
64 | if (ports[i].protocol == readymail_protocol_tls)
65 | startTLS = true;
66 | else
67 | startTLS = false;
68 | }
69 | }
70 | }
71 |
72 | // Internal used functions.
73 | bool connectSSL()
74 | {
75 | #if defined(READYCLIENT_TYPE_1)
76 | return ssl_client->connectSSL();
77 | #elif defined(READYCLIENT_TYPE_2)
78 | return ssl_client->startTLS();
79 | #endif
80 | return false;
81 | }
82 | };
83 |
84 | #endif
85 | #endif
--------------------------------------------------------------------------------
/resources/docs/TROUBLESHOOTING.md:
--------------------------------------------------------------------------------
1 | # 🧯 TROUBLESHOOTING — ReadyMail
2 |
3 | This document outlines known issues across supported platforms and provides solutions or workarounds to help developers resolve common problems when using ReadyMail.
4 |
5 | ---
6 |
7 | ## 📚 Table of Contents
8 |
9 | - [ESP8266 Issues](#-esp8266-issues)
10 | - [ESP32 Issues](#-esp32-issues)
11 | - [ESP_SSLClient Issues](#-esp_sslclient-issues)
12 | - [IMAP Response Parsing](#-imap-response-parsing)
13 |
14 | ---
15 |
16 | ## ⚠️ ESP8266 Issues
17 |
18 | ### 🔧 Buffer Configuration
19 |
20 | ESP8266's `WiFiClientSecure` requires buffer tuning to avoid crashes during SSL connections.
21 |
22 | ```cpp
23 | ssl_client.setBufferSizes(1024, 1024);
24 | ```
25 |
26 | This reduces memory usage and enables SSL fragmentation.
27 |
28 | ### 🧠 Heap Configuration
29 |
30 | Ensure proper MMU settings:
31 |
32 | - Arduino IDE:
33 | `Tools > MMU: 16KB cache + 48 KB IRAM and 2nd Heap (shared)`
34 | - PlatformIO:
35 | ```ini
36 | build_flags = -D PIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48_SECHEAP_SHARED
37 | ```
38 |
39 | ### ⚡ Power Supply
40 |
41 | Use a stable, low-noise power source with short, low-impedance cables to prevent brownouts during SSL handshake.
42 |
43 | ---
44 |
45 | ## ⚠️ ESP32 Issues
46 |
47 | ### 🐞 Plain Mode Hang (v3.x)
48 |
49 | Calling `setPlainStart()` on `WiFiClientSecure` in ESP32 v3.x may cause `connected()` to hang for 30 seconds due to lwIP select bug.
50 |
51 | **Workaround:** Avoid using plain mode or wait for upstream fix.
52 |
53 | ### 🔥 SSL/Plain Conflict
54 |
55 | If `setPlainStart()` is called while still connected in SSL mode, data corruption or unexpected errors may occur.
56 |
57 | **Recommendation:** Use SSL mode only unless protocol upgrade is explicitly required.
58 |
59 | ---
60 |
61 | ## ⚠️ ESP_SSLClient Issues
62 |
63 | ### 🧠 Memory Allocation Failures
64 |
65 | On devices like Renesas (UNO R4 WiFi) or SAMD (MKR WiFi 1010), TLS handshake may fail due to limited RAM.
66 |
67 | **Solution:**
68 |
69 | ```cpp
70 | ssl_client.setBufferSizes(1024, 1024);
71 | ```
72 |
73 | Also ensure:
74 |
75 | ```cpp
76 | ssl_client.setClient(&basic_client);
77 | ssl_client.setInsecure();
78 | ```
79 |
80 | ### 🐢 Compilation Slowness
81 |
82 | Due to BearSSL's large C codebase, compilation may be slow in Arduino IDE. Consider disabling antivirus interference or using PlatformIO.
83 |
84 | ---
85 |
86 | ## ⚠️ IMAP Response Parsing
87 |
88 | ### 🧩 Chunked Header Limitations
89 |
90 | Some IMAP servers report incorrect decoded sizes for `text/plain` and `text/html`, causing `fileSize = 0`.
91 |
92 | **Impact:** Progress tracking and chunk indexing may be unreliable.
93 |
94 | **Recommendation:** Use `fileChunk().isComplete` to detect final chunk and avoid relying on `fileSize`.
95 |
96 | ### 🧠 Memory Constraints
97 |
98 | Parsing large multi-line IMAP responses may fail on low-RAM devices. Consider using `WiFiSSLClient` or limiting fetch size.
99 |
100 | ---
101 |
102 | ## 📄 License
103 |
104 | MIT License © 2025 Suwatchai K (Mobizt).
105 | See [LICENSE](LICENSE) for details.
106 |
--------------------------------------------------------------------------------
/examples/Network/EthernetClient/EthernetClient.ino:
--------------------------------------------------------------------------------
1 | /**
2 | * The example to use WIZnet W5500 SPI Ethernet module and ESP32
3 | * to connect to SMTP server.
4 | *
5 | * The Ethernet libraries are used in this example.
6 | *
7 | * For proper network/SSL client and port selection, please see http://bit.ly/46Xu9Yk
8 | */
9 | #include
10 | #include
11 |
12 | #define ENABLE_SMTP // Allows SMTP class and data
13 | #define ENABLE_DEBUG // Allows debugging
14 | #define READYMAIL_DEBUG_PORT Serial
15 | #include
16 | #include
17 |
18 | #include