|Subject:||Re: adding an image to an email|
|Posted by:||Remy Lebeau (TeamB) (email@example.com)|
|Date:||Thu, 14 Apr 2005|
"John Evans" <johneva…@clear-Advantage.co.uk> wrote in message
> with TIdAttachment.Create(email.MessageParts, PictureFilename )
You are setting the ContentType of the TIdMessage, not the TIdAttachment.
And you did not set the ContentID property of the TIdAttachment at all. You
need to do so. Otherwise, the HTML cannot find the image when displayed.
with TIdAttachment.Create(email.MessageParts, PictureFilename) do
ContentID := 'SomeUniqueValueForThisFile';
ContentType := GetMimeTypeFromFile(PictureFilename);
Then the HTML references the image like this:
> My understanding from the help file is that I have to use
> TidAttachment for images.
Yes. But you are only using it partially. Setting the filename only is not
enough to make it available to HTML documents.
adding an image to an email posted by John Evans on Thu, 14 Apr 2005