Skip to content

Commit 70dfd7e

Browse files
committed
Refactor EMailSender to improve chunk encoding and sending for string content; update OpenSLab SSL client enablement instructions #55 #54
1 parent 4c15063 commit 70dfd7e

File tree

7 files changed

+17
-9
lines changed

7 files changed

+17
-9
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# EMailSender Library v4.1.0
1+
# EMailSender Library v4.1.1
22

33
![EMailSender Logo](https://raw.githubusercontent.com/xreef/EMailSender/master/resources/EMailSenderLogo.jpg)
44

@@ -155,7 +155,7 @@ Complete tutorials and articles available on [mischianti.org](https://www.mischi
155155
Add to your `platformio.ini`:
156156
```ini
157157
lib_deps =
158-
xreef/EMailSender@^4.1.0
158+
xreef/EMailSender@^4.1.1
159159
```
160160

161161
### Manual Installation
@@ -275,6 +275,9 @@ For boards with limited RAM (like Arduino Uno):
275275
- Regular account password will not work
276276
277277
## Change log v4.x
278+
- 10/11/2025: v4.1.1
279+
- Minor enhancements: add support for Stream and String attachments improvements
280+
- Bug fixes: edge-case encoding issues and small fixes in attachment handling
278281
- 10/11/2025: v4.1.0
279282
- Add Stream and File as attachement type
280283
- Bug fix for size and encoding

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
},
1717
"url": "https://www.mischianti.org/category/my-libraries/emailsender-send-email-with-attachments/",
1818
"frameworks": "Arduino",
19-
"version": "4.1.0",
19+
"version": "4.1.1",
2020
"platforms": "*"
2121
}

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=EMailSender
2-
version=4.1.0
2+
version=4.1.1
33
author=Renzo Mischianti <renzo.mischianti@gmail.com>
44
maintainer=Renzo Mischianti <renzo.mischianti@gmail.com>
55
sentence=Send EMail via SMTP with STARTTLS support, library for Raspberry Pi Pico W, Arduino, SAMD (WiFiNINA), STM32, esp8266 and esp32.

src/EMailSender.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,14 +1238,16 @@ EMailSender::Response EMailSender::send(const char* to[], byte sizeOfTo, byte s
12381238
tBuf[j] = stringContent.charAt(pos + j);
12391239
}
12401240
// Encode and send chunk
1241-
client.write(encode64((byte*)tBuf, chunkSize).c_str());
1241+
const char* encoded = encode64_f((char*)tBuf, chunkSize);
1242+
client.print(encoded);
12421243
}
12431244
} else {
12441245
EMAIL_SENDER_DEBUG_PRINTLN(F("NORMAL write from String"));
12451246
// Send string content directly in chunks
12461247
for (size_t pos = 0; pos < totalSize; pos += 512) {
12471248
size_t chunkSize = min((size_t)512, totalSize - pos);
1248-
client.write(stringContent.substring(pos, pos + chunkSize).c_str());
1249+
String chunk = stringContent.substring(pos, pos + chunkSize);
1250+
client.print(chunk);
12491251
}
12501252
}
12511253

src/EMailSender.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* EMail Sender Arduino, esp8266, stm32 and esp32 library to send email
33
*
44
* AUTHOR: Renzo Mischianti
5-
* VERSION: 4.1.0
5+
* VERSION: 4.1.1
66
*
77
* https://www.mischianti.org/
88
*

src/EMailSenderKey.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* EMail Sender Arduino, esp8266, stm32 and esp32 library to send email
33
*
44
* AUTHOR: Renzo Mischianti
5-
* VERSION: 4.1.0
5+
* VERSION: 4.1.1
66
*
77
* https://www.mischianti.org/
88
*

src/EMailSender_OpenSLabUnity.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
* This is necessary because the Arduino IDE has limitations on how it discovers and compiles source files in subdirectories.
1010
*/
1111

12-
#define EMAIL_ENABLE_OPENSLAB_SSLCLIENT
12+
// NOTE: Do NOT force-enable EMAIL_ENABLE_OPENSLAB_SSLCLIENT here.
13+
// The feature should be enabled explicitly in EMailSenderKey.h or via build flags
14+
// (for example -DEMAIL_ENABLE_OPENSLAB_SSLCLIENT) so users control whether
15+
// the OpenSLab SSL client backend is compiled.
1316

1417
#if defined(EMAIL_ENABLE_OPENSLAB_SSLCLIENT) && !defined(EMAIL_ENABLE_EXTERNAL_SSLCLIENT_OPENSLAB)
1518

0 commit comments

Comments
 (0)