Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi Outlook HTML-Mail mit Bildern (https://www.delphipraxis.net/30425-outlook-html-mail-mit-bildern.html)

vsti 24. Sep 2004 15:21


Outlook HTML-Mail mit Bildern
 
Moin moin,

also, mit Hilfe von den Indy Compos und

Delphi-Quellcode:
  Att:=TIDAttachment.Create(IdMessage1.MessageParts,'c:\logo.gif');
  Att.ContentDisposition := 'attachment';
  Att.ExtraHeaders.Values['content-id']:=ExtractFileName('c:\logo.gif');
kann man ja in eine Mail ein Bild integrieren und in der Mail dann mit

Code:
  <DIV><IMG src=3D"cid:logo.gif"></DIV>
in z.B. Outlook als HTML-Mail anzeigen lassen. Alles super soweit.

Wie kann ich aber selbiges an Outlook übergeben bevor ich die Mail sende? Damit auch in Outlook dokumentiert wird was ich gesendet habe.

Delphi-Quellcode:
const
  olMailItem = 0;
var
  Outlook: OleVariant;
  vMailItem: variant;
  SList: TStringList;
begin
  try
    Outlook := GetActiveOleObject('outlook.Application');
  except
    Outlook := CreateOleObject('outlook.Application');
  end;
  vMailItem := Outlook.CreateItem(olMailItem);
  vMailItem.Recipients.Add(Recipient);
  vMailItem.Subject := Subject;

  SList :=TStringList.Create;
  SList.LoadFromFile(HTMLFile);
  vMailItem.HTMLBody := SList.Text;

  vMailItem.Attachments.Add('c:\logo.gif');
  vMailItem.Display;
funktioniert zwar, aber wie übergebe ich die "content-id" wie bei Indy oben, damit das Bild in der Mail dargestellt werden kann und dabei nicht das Bild auf der lokalen Festplatte gesucht wird?

Verständlich?

Recherchen im Inet und Foren waren bis jetzt erfolglos...


Alle Zeitangaben in WEZ +1. Es ist jetzt 07:36 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz