Autor Beitrag
F.Art
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 434



BeitragVerfasst: So 16.11.03 16:10 
Wie kann ich bei idMessage (Indy) eine HTML eMail senden?
StefanH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: So 16.11.03 16:18 

_________________
"Als es noch keine Computer gab, war das Programmieren noch relativ einfach."(Edsger W. Dijkstra)
"Ich bin nicht von Sinnen, sondern ich rede wahre und vernünftige Worte." (Paulus)
F.Art Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 434



BeitragVerfasst: So 16.11.03 16:22 
Das ist wie man überhaupt eMails mit Indy sendet.
Mit dem Outlook Express kann man auch HTML eMails senden und dies möchte ich gerne in mein eMail Sender auch ein programmieren.
Nur leider weis ich nicht wie ich das anstellen soll.
Licki
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 132

Knoppix, Win 95, Win 2000, Win NT, Win 98, Win XP
Delphi 3
BeitragVerfasst: So 16.11.03 16:37 
Das geht, indem du einfach die HTML-Befehle nutzen tust. Wenn dann die Mail zum Beispiel beim Empfänger mit HTML-Befehlen ankommt, erkennt das Mailprogramm dies und macht daraus eine HTML-Mail.
F.Art Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 434



BeitragVerfasst: So 16.11.03 17:58 
Das funtioniert so nicht die Befehle kommen als Text an.
Licki
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 132

Knoppix, Win 95, Win 2000, Win NT, Win 98, Win XP
Delphi 3
BeitragVerfasst: So 16.11.03 18:30 
Hm, stimmt, das war nicht ganz richtig von mir. Sorry, ...

Es gibt ja einen Mail-Header. Darin steht alles mögliche, wie zum Beispiel die Mail-Adresse des Absenders, der Host, die Zeit und so weiter... Ob es eine HTML-Mail ist erkennt das Mailprogramm mit dieser Header-Angabe:

HTML-Mails:
Zitat:

Content-Type: multipart/alternative;


Text-Mails:
Zitat:

Content-Type: text/plain;


In deinem Fall eben Content-Type: multipart/alternative; .
F.Art Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 434



BeitragVerfasst: So 16.11.03 18:48 
Das geht bei mir auch nicht.
Licki
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 132

Knoppix, Win 95, Win 2000, Win NT, Win 98, Win XP
Delphi 3
BeitragVerfasst: So 16.11.03 19:12 
Ich habe Indy leider gerade nicht zur Hand, muss es also im Kopf machen.

Klicke mal die idMessage-Kompo auf deinem Formular an und dann findest du ja beim Objektinspektor die Einstellungsmöglichkeiten etc. . Klicke dort mal doppelt auf "Headers". Dann öffnet sich ja der Stringlisten-Editor. Gib dort mal dies ein:

Zitat:

Content-Type=multipart/alternative


Und nun versuche das ganze nochmal.
F.Art Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 434



BeitragVerfasst: So 16.11.03 20:00 
ne geht auch nicht
F.Art Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 434



BeitragVerfasst: Mo 17.11.03 22:55 
Habe das Prob gefunden,
es heist nicht multipart/alternative sondern so geht es

ausblenden Delphi-Quelltext
1:
idMessage.ContentType := 'text/html;';					
barfuesser
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 324



BeitragVerfasst: Di 18.11.03 17:09 
Der von Dir angegebene Content-type sollte funktionieren. Er hat nur das Problem, daß aller EMail-Clients, die nur Text (Content-type: text/plain) verarbeiten, Deine EMail nicht darstellen oder verarbeiten können. Wenn Du also EMails mit einem anderen Content-type als text/plain versenden möchtest, solltest Du MultiPart-EMails benutzen. Dazu muß im Content-type multipart/... angegeben werden. Desweiteren müssen die einzelnen Abschnitte im Mail-Header und im Mail-Body gekennzeichnet werden. Wie Du das machst, kann ich Dir jetzt aber nicht aus dem Hut zaubern. Solltest Du vielleicht mal nach googeln.

barfuesser
F.Art Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 434



BeitragVerfasst: Di 18.11.03 20:22 
Das wäre toll wenn jemand mir diese Lösung erklären könnte.
Dann würde ich das mit dem Multipart machen.