Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Mar : Re: HTML and indy 9

www.cryer.info
Managed Newsgroup Archive

Re: HTML and indy 9

Subject:Re: HTML and indy 9
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Thu, 22 Mar 2007 13:07:05

"AORANGI" <aorangi&@wanadoo.fr> wrote in message
news:4602da72@newsgroups.borland.com...

> In the exemple they talk about a contentID. Well D7 tell me
> Unknow when I put it like
> in the exemple in{A} ContendID:='TeteLettre.jpg';

You are likely using an outdated version of Indy that did not have the
ContentID property added yet.  You should upgrade to a newer snapshot.
If you are not going to upgrade, then you will have to use the Headers
property instead:

    Headers.Values['Content-ID'] := 'TeteLettre.jpg';

>  With TIdtext.Create(idMessage1.MessageParts,nil) do
>  begin
> ContendID:='TeteLettre.jpg';

You should not be setting the ContentID for the message part that
contains the HTML.  You need to set the ContentID on the individual
image attachments instead.  The HTML can then refer to the ContentID
of each image that it wants to display.

Did you read the article I mentioned in my previous reply?

> <IMG SRC="cid:/TeteLettre.jpg" WIDTH="709" HEIGHT="116"'

Why did you put a '/' in front of the ID?  Get rid of that:

    <IMG SRC="cid:TeteLettre.jpg" WIDTH="709" HEIGHT="116"'

>  ContentType:='Text/Html';

Use all-lowercase letters:

    ContentType := 'text/html';

> With TIdAttachment.Create(IdMessage1.MessageParts,
>  'c:\MailingApplication\TexteMessage\TeteLettre.jpg') do
>  Begin

    ContentID := 'TeteLettre.jpg'; // add this
    // or this:
    // Headers.Values['Content-ID'] := 'TeteLettre.jpg';

>  ContentType:='Image/jpeg';

Again, use all-lowercase letters:

    ContentType := 'image/jpeg';


Gambit

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive