I had previously asked a question here. replace-cidimage-refrences-in-email-body The question came about because I am writing a basic email archiver/ archived email viewer.
I had saved the body using
IdMessage.Body.SaveToFile(FileName);
With the CID references in that body replaced with base64-encoded images, the resulting HTML displays in a TWebBrowser
component when loaded from a blob field in my database. So I have an email viewer now.
The next requirement is to allow a reply to this email. I've added a TEdit
above the TWebBrowser, where the UI user can type their single line reply, and I'm using some code to patch the html body to insert the reply line
Reply := '<p class=MsoPlainText>';
Reply := Reply + edReply.Text + '<br>';
Reply := Reply + '<br>-----Previous Message-----<br><br>';
Reply := Reply + '</p>';
before the first <p class=MsoPlainText
in that body. This email, sent via IdSMTP, looks good, but Outlook isn't interested in displaying those inline base64-endoded images at all. I need to go back to where I started with this!
I would much like to do something like this:
When the original message is received, save it entirely using this
IdMessage.SaveToFile(FBasePath + 'raw_' + MessageID + '.html'); // works, and can be read by M$ Word
Then formulate that into a reply
IdMessage.LoadFrom(FBasePath + 'raw_' + MessageID + '.html');
IdMessage.Recipients.EmailAddresses := IdMessage.From.Address;
IdMessage.From.Address := repliersaddress;
But now the question is, how do I add the reply text to this html email.
IdMessage.InsertReply(edReply.Text); // would be great
Thanks