Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Mar : Re: HTML and indy 9
| Subject: | Re: HTML and indy 9 |
| Posted by: | "Claude" (aorang..@wanadoo.fr) |
| Date: | Thu, 22 Mar 2007 21:45:55 |
So! This is what I wrote and I did try but I get only
a line on the top and then my image but the body is lost on the way. I put a
html text as a try.
So i am sorry but down the code I wrote. What do you see wrong.
IdMessage1.ContentType:='multipart/mixed;type=text/html';
With TIdtext.Create(idMessage1.MessageParts,nil) do
begin
Body.Text:= '<HEAD> <META NAME="GENERATOR" CONTENT="Adobe PageMill 3.0
Win">'+
'<TITLE>Document sans titre</TITLE></HEAD><BODY BGCOLOR="#ffffff">'+
'<P><IMG SRC=cid:tetelettre.jpg>WIDTH="680" HEIGHT="113" ALIGN="BOTTOM" '+
'BORDER="0" NATURALSIZEFLAG="3"></P><P> </P>'+
'<P><B>Approvisionnement en fournitures et livres scolaires pour'+
'la rentrée scolaire 2007/2008</B></P><P>Madame la Directrice,
Monsieur le Directeur,</P>'+
'<P>En France mais aussi particulièrement à
l''étranger,'+
'la course aux fournitures et aux livres scolaires est <BR>'+
'une activité redoutée par les parents
d''élèves.<BR>'+
'Les mêmes questions se posent à tous:<BR>'+
'" <B><FONT COLOR="#ff0000">0ù</FONT></B><FONT
COLOR="#ff0000">'+
'</FONT>trouver sans perte de temps tous les livres demandés'+
'<BR><BODY><HTML>';
ContentType:='text/html';
end;
With TIdAttachment.Create(IdMessage1.MessageParts,
'c:\MailingApplication\TexteMessage\TeteLettre.jpg') do
Begin
Headers.Values['Content-ID'] := 'tetelettre.jpg';
ContentType:='image/jpeg';
FileName:='tetelettre.jpg';
end;
I am soryy, I am not very bright in cetain thing but well
Thank for your reply.
claude
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> a écrit dans le message de news:
4602e274$2@newsgroups.borland.com...
>
> "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