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 23:11:50 |
Well
Sorry i did try that to. the probleme is that I get the heading but not the
body. If I take the TidAttachment.create procedure out and keep only le
TidText.create I get a blank window. So it seems that the TidText don't
work.
Don't get hangry but that the problem.
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;
IdMessage1.ContentType := 'multipart/related; type="text/html"';
So
Claude
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> a écrit dans le message de news:
4602fc73$1@newsgroups.borland.com...
>
> "Claude" <aorangi&@wanadoo.fr> wrote in message
> news:4602ea80$1@newsgroups.borland.com...
>
>> 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.
>
> That is because you are still not setting it up correctly. You did
> not read the article I pointed you to very carefully.
>
>> IdMessage1.ContentType:='multipart/mixed;type=text/html';
>
> That is wrong. The 'type' attribute is only used with
> 'multipart/related', never with 'multipart/mixed'. If all you are
> adding is one HTML part and image attachments, then you need to use
> 'multipart/related' instead, ie:
>
> IdMessage1.ContentType := 'multipart/related; type="text/html"';
>
> ContentID has no meaning outside of a 'multipart/related' grouping.
>
>
> Gambit
none