My code was made based on those webpages.
What are those missing parts? Cannot see them, I think my code is complete.
The code you have shown is NOT complete, as it is not creating enough
TIdText objects as required for your MIME emails. The code you have shown is creating only 1
TIdText object, but you actually need 3 separate
TIdText objects instead, eg:
IdAlternative := TIdText.Create(MailMessage.MessageParts, nil);
IdText.ContentType := 'multipart/alternative';
IdPlainText := TIdText.Create(MailMessage.MessageParts, nil); // <-- add this!
IdPlainText.ContentType := 'text/plain';
IdPlainText.ParentPart := IdAlternative.Index;
IdHTML := TIdText.Create(MailMessage.MessageParts, nil); // <-- add this!
IdHTML.Body.LoadFromFile(sendHTMLFile);
IdHTML.ContentType := 'text/html';
IdHTML.ParentPart := IdAlternative.Index;
Then your send loop can update
IdPlainText.Body and
IdHTML.Body as needed.
This is clearly explained in my blog articles. So, either the code you have shown is really missing those extra steps, or you have simply not shown everything you are really doing.