![]() |
E-Mail Body richtig anzeigen
Hallo alle zusammen,
Ich lade mit diesem Code den Inhalt einer E-Mail von einem Pop3 Server:
Delphi-Quellcode:
Das funktioniert auch soweit, allerdings werden HTML E-Mails natürlich nicht richtig dargestellt. Wie könnte ich das hinbekommen? Gibt es dafür vielleicht eine Komponente oder so?
//mail laden
pop3.Retrieve(mailindex, mailinfo); //details eintragen fo_browser.edAbsender.Text:=mailinfo.From.Text; fo_browser.edDatum.Text:=FormatDateTime('dd mmm yyyy hh:mm:ss', mailinfo.Date); fo_browser.edBetreff.Text:=mailinfo.Subject; //body eintragen for intIndex := 0 to Pred(mailinfo.MessageParts.Count) do begin if (mailinfo.MessageParts.Items[intIndex] is TIdAttachment) then begin fo_browser.mailtext.Lines.Add(TIdAttachment(mailinfo.MessageParts.Items[intIndex]).Filename); end else begin if mailinfo.MessageParts.Items[intIndex] is TIdText then begin fo_browser.mailtext.Lines.AddStrings(TIdText(mailinfo.MessageParts.Items[intIndex]).Body); end end; end; Schonmal danke... |
Re: E-Mail Body richtig anzeigen
|
Re: E-Mail Body richtig anzeigen
mhh... ich probiere hier gerade etwas rum...
aber wie muss ich den E-Mail Body dem WebBrowser übergeben? :gruebel: Mit Navigate geht es anscheinend nicht... |
Re: E-Mail Body richtig anzeigen
Hi,
speichere den body temporär als html und öffne ihn dann mit navigate. Viele Grüße .... |
Re: E-Mail Body richtig anzeigen
Zitat:
![]() |
Re: E-Mail Body richtig anzeigen
Zitat:
Delphi-Quellcode:
procedure WB_LoadHTML(WB : TWebBrowser; AHTMLCode: TStrings);
var myDocument : OleVariant; begin if WB.Document = nil then WB.Navigate('about:blank'); myDocument:= WB.Document; myDocument.Clear; myDocument.Write(AHTMLCode.Text); myDocument.Close; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:11 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz