I'm trying to send a email with indy 9:
- Body as RTF, formatted from a TRichEdit
- A single file attached
The code:
Message := TIdMessage.Create()
Message.Recipients.EMailAddresses := 'someone@domain.dotcom';
Message.ContentType := 'multipart/alternative';
with TIdText.Create(Message.MessageParts) do
ContentType := 'text/plain';
with TIdText.Create(Message.MessageParts) do
begin
ContentType := 'text/richtext';
Body.LoadFromFile('c:\bodymsg.rtf');
end;
TIdAttachment.Create(Message.MessageParts, 'c:\myattachment.zip');
// send...
The result: body comes empty (using web gmail and outlook 2010 as clients).
I'm already tried other content types without success:
- text/rtf
- text/enriched
NOTE: I'll not upgrade to Indy 10.