Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Aug : Indy 10 IdMessage text/html with unrelated attachment

www.cryer.info
Managed Newsgroup Archive

Indy 10 IdMessage text/html with unrelated attachment

Subject:Indy 10 IdMessage text/html with unrelated attachment
Posted by:"Matt Leonard" (futur..@gotadsl.co.uk)
Date:Thu, 10 Aug 2006 14:48:21

Hi,

I'm new to Delphi and Indy so apologies if I don't explain myself well. I am
trying to setup an email send routine for my application. The routine seemed
to work fine with the Delphi7 supplied version of Indy7 but now I'm having a
small problem. I am sending a html and plain-text email with an un-related
attachment, when the message arrives in my email client I now see the html
part as an attachment rather then just in the message body. I have probably
just missed something simple but my brain has now melted trying to find
what.

Indy7 received message:
www.mjleonard.me.uk/indy/indy7.jpg
www.mjleonard.me.uk/indy/indy7.txt

Indy10 received message:
www.mjleonard.me.uk/indy/indy10.jpg
www.mjleonard.me.uk/indy/indy10.txt

Here is the relevant Delphi code:
  IdMessage1.ContentType := 'multipart/mixed';
  textbody := TIdText.Create(IdMessage1.MessageParts, nil);
  textbody.Body.Text := ProfDHTMLEdit1.PlainText;
  textbody.ContentType := 'text/plain';
  htmlbody := TIdText.Create(IdMessage1.MessageParts, nil);
  htmlbody.Body.Text := ProfDHTMLEdit1.Source;
  htmlbody.ContentType := 'text/html';
  attachment := TIdAttachmentfile.Create(IdMessage1.MessageParts,
'c:\attach.txt');


Thanks for looking,

Matt Leonard

Replies:

www.cryer.info
Managed Newsgroup Archive