TMSFMXCloudGMail1.Mails.Items[i].(HTML)Body is empty

I need to retrieve content from the body of a message in my GMail account. I can list all mails but when I read both .Body or .HTMLBody do not contain any information. .Body is empty and .HTMLBody only contains '<!doctype html'. Only .Snippet contains a bit more text, but not the whole message.

How can I read all content of an e-mail and manipulate this text to retrieve some information.


We are not aware of any issues with email body parsing at this time.
Can you please make sure you are using the latest version of TMS FMX Cloud Pack?

As far as I can see I am using the latest version. Downloaded and installed today.
How to know for sure?

Please note that GMail support in TMS FMX Cloud Pack is primarily focused on sending email and has limited capabilities to parse existing HTML emails.

Going forward our focus is on TMS FNC Cloud Pack.
The new TMS FNC Cloud Pack has much improved email reading functionalities including HTML parsing and attachment handling. Detailed information and a fully functional trial version are available from:

From a client perspective this is a rather strange answer. Mail functionality is not limited to sending. Reading mail is just and maybe even more important. Being able to read my mailbox and being able to process the content of automatic and standardized e-mails with shipping confirmations is the only reason why we use the FMX Cloudpack.

So we do not accept this. When I buy a pack I can expect all API functionality GMail offers to be supported. Sending and reading mail is basics and should work.

I do not wanto use FNC. You offer the FMX pack, so it must work.
I bought the FMX Cloud Pack and expect all basics to work. Being able to read the body of an e-mail is basic and one can expect this to work.

Solve this!

When debugging I have found the decoding of the raw mailcontent is not working properly. It breaks the decoding after several characters and thus I can only see the 20 or so first characters of the mail content. So hope this helps you to solve this!

Met een beetje hulp van ChatGPT heb ik deze aanpassing gedaan in jullie code en lijkt te werken.

function DecodeRawContent(rawContent: string): string;
decodedBytes: TBytes;
decodedBytes := TNetEncoding.Base64URL.DecodeStringToBytes(rawContent);
Result := TEncoding.UTF8.GetString(decodedBytes);

function TTMSFMXCloudCustomGMail.GetMessage(AMessageId: string): TGmailMessage;

procedure _DecodeRawMessage(var Msg: TGmailMessage);
if Msg.MessageType = mtPlainText then
Msg.Body := DecodeRawContent(Msg.Raw)
Msg.HTMLBody := DecodeRawContent(Msg.Raw);