MessageParts.Clear

Giganews Newsgroups
Subject: MessageParts.Clear
Posted by:  Richard Hayward (richa…@tortoise.demon.co.uk)
Date: Tue, 24 Mar 2009

Hi,

I'm using D6 with Indy 8.0.25.
I have a message, to which an attachment has been added, using

TIdAttachment.Create(IdMessage.MessageParts, OpenDialog.FileName);

I then want to remove this, and any other attachments, using

IdMessage.MessageParts.Clear;

but when I send this message, supposedly without attachments, the raw
message looks something like this:

From: richa…@.somewhere.com
Subject: Here is my subject
To: richa…@somewhere.else.com
Content-Type: multipart/mixed;
boundary="=_NextPart_2rfkindysadvnqw3nerasdf";;
Date: Mon, 23 Mar 2009 23:46:48 +0000
X-Priority: 3
X-Library: Indy 8.0.25

This is a test message.

It looks to me as though the Content-Type and boundary values
shouldn't be there. They are certainly absent if I send a message
without any attachment. How can I remove them? Is MessageParts.clear
not alone sufficient to remove attachments?

Regards
Richard

Replies