How to convert the received email as html format to plain text ? #285
Replies: 4 comments 5 replies
-
I don't get what is your problem and requirement as you still get all characters included line break in both text and html. There is no missing octet (byte) of message body and attachment that fetched from your mailbox as the response size is known. |
Beta Was this translation helpful? Give feedback.
-
The text string that includes the line break should be something like this
Which will be displayed as
|
Beta Was this translation helpful? Give feedback.
-
To get text from html, you need the HTML parser which may be available as C/C++ library which the code size may not fit with flash space or requires other dependencies. |
Beta Was this translation helpful? Give feedback.
-
i will show you one example of an email. This email was bild withThis is the complete email text per Text (msg.text.content):Line 1Line 2Line 3Gesendet von Mail für Windows This is the complete email text per HTML (msg.html.content):What i wish is this text with line breaks:Line 1 Gesendet von Mail für Windows I didn't download the messages as file in the filesystem. I only use the variables for the messages and write a serial logging. I haven't the line breaks within the variable msg.text.content. Am I misinterpreting something? |
Beta Was this translation helpful? Give feedback.
-
Hi mobiz,
i want to download the text context of new received emails with your great library.
If the mcu gets the raw text, they is able to collect commandos as words in stringformat.
When the microcomputer received emails in text-format
(imap_data.enable.text = true), the carrige returns between the lines are missing.
That's why words are put together.
Because of this I want to get the HTML message (imap_data.enable.html = true)
and later extract the raw text with line breaks and spaces between words.
Do you now a simple existing solution for that ?
Best greetings,
electrolyt
Build tool used:
Arduino IDE 2.2.1
Board used (ESP32/ESP8266/Arudino):
Seeeduino Xiao ESP32-S3
Other Libraries That are used:
<AsyncElegantOTA.h>
<ESPmDNS.h>
<WiFi.h>
Description of problem:
See above.
Beta Was this translation helpful? Give feedback.
All reactions