From df78d3198c2e4965197288f8391d68c909c0acf7 Mon Sep 17 00:00:00 2001 From: suwatchai Date: Sat, 11 Apr 2020 09:32:21 +0700 Subject: [PATCH] Fix the size of SMTP sending attachment data limit issue. --- README.md | 2 +- library.properties | 2 +- src/ESP32_MailClient.cpp | 12 ++++++------ src/ESP32_MailClient.h | 10 +++++----- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index ae8ab3d..e6a96e8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Mail Client Arduino Library for ESP32 v 2.1.2 +# Mail Client Arduino Library for ESP32 v 2.1.3 This library allows ESP32 to send Email with/without attachment and receive Email with/without attachment download via SMTP and IMAP servers. diff --git a/library.properties b/library.properties index 8adff21..7e3554c 100644 --- a/library.properties +++ b/library.properties @@ -1,6 +1,6 @@ name=ESP32 Mail Client -version=2.1.2 +version=2.1.3 author=Mobizt diff --git a/src/ESP32_MailClient.cpp b/src/ESP32_MailClient.cpp index 4d2349e..b33e7d5 100644 --- a/src/ESP32_MailClient.cpp +++ b/src/ESP32_MailClient.cpp @@ -1,7 +1,7 @@ /* - *Mail Client Arduino Library for ESP32, version 2.1.2 + *Mail Client Arduino Library for ESP32, version 2.1.3 * - * April 10, 2020 + * April 11, 2020 * * This library allows ESP32 to send Email with/without attachment and receive Email with/without attachment download through SMTP and IMAP servers. * @@ -4480,11 +4480,11 @@ attachmentData::~attachmentData() std::vector().swap(_filename); std::vector().swap(_id); std::vector().swap(_type); - std::vector().swap(_size); + std::vector().swap(_size); std::vector().swap(_mime_type); } -void attachmentData::add(const String &fileName, const String &mimeType, uint8_t *data, uint16_t size) +void attachmentData::add(const String &fileName, const String &mimeType, uint8_t *data, size_t size) { _filename.push_back(fileName.c_str()); _mime_type.push_back(mimeType.c_str()); @@ -4524,7 +4524,7 @@ void attachmentData::free() std::vector().swap(_filename); std::vector().swap(_id); std::vector().swap(_type); - std::vector().swap(_size); + std::vector().swap(_size); std::vector().swap(_mime_type); _index = 0; } @@ -4777,7 +4777,7 @@ String SMTPData::getBCC(uint8_t index) return _bcc[index].c_str(); } -void SMTPData::addAttachData(const String &fileName, const String &mimeType, uint8_t *data, uint16_t size) +void SMTPData::addAttachData(const String &fileName, const String &mimeType, uint8_t *data, size_t size) { _attach.add(fileName, mimeType, data, size); } diff --git a/src/ESP32_MailClient.h b/src/ESP32_MailClient.h index 9184e57..b7c98be 100644 --- a/src/ESP32_MailClient.h +++ b/src/ESP32_MailClient.h @@ -1,7 +1,7 @@ /* - *Mail Client Arduino Library for ESP32, version 2.1.2 + *Mail Client Arduino Library for ESP32, version 2.1.3 * - * April 10, 2020 + * April 11, 2020 * * This library allows ESP32 to send Email with/without attachment and receive Email with/without attachment download through SMTP and IMAP servers. * @@ -592,10 +592,10 @@ class attachmentData std::vector _filename = std::vector(); std::vector _id = std::vector(); std::vector _type = std::vector(); - std::vector _size = std::vector(); + std::vector _size = std::vector(); std::vector _mime_type = std::vector(); - void add(const String &fileName, const String &mimeType, uint8_t *data, uint16_t size); + void add(const String &fileName, const String &mimeType, uint8_t *data, size_t size); void remove(uint8_t index); void free(); String getFileName(uint8_t index); @@ -1672,7 +1672,7 @@ class SMTPData @param size - The data length in byte. */ - void addAttachData(const String &fileName, const String &mimeType, uint8_t *data, uint16_t size); + void addAttachData(const String &fileName, const String &mimeType, uint8_t *data, size_t size); /*