Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Pdf Datei als Anhang Indy 10 (https://www.delphipraxis.net/166928-pdf-datei-als-anhang-indy-10-a.html)

mario-g 6. Mär 2012 09:50

Pdf Datei als Anhang Indy 10
 
Hi Leute,

habe ein Problem mit einem PDf Anhang an einer Mail mittels INDY 10.
Die Mail wird ordnungsgemäß versendet, der Anhang ist auch dabei, aber wird umbenannt z.B. zu: "Unbenannte Anlage 00189.dat" (Outlook 2010).
Wenn ich die Datei als 'xxx.pdf' speichere, kann ich die PDF Datei auch öffnen und ist auch ok. Woran kann das liegen, dass die Datei einfach umbenannt wird?
hier mal ein das Wichtigste:

...
var
idSMTP : TidSMTP;
idText : TidText;
EMessage : TidMessage;
Attachment : TIdAttachmentFile;
begin
Attachment := nil;
idSMTP := TidSMTP.Create(nil);
EMessage := TidMessage.Create(nil);

with EMessage do
begin
CharSet := 'iso-8859-1';
From.Address := '...';
From.Name := '...';

Recipients.EMailAddresses := '...';
CCList.EMailAddresses := '...';
Subject := 'Test';

idText := TidText.Create(MessageParts, nil);
IdText.CharSet := 'iso-8859-1';
idText.ContentType := 'text/plain';
idText.ContentTransfer := 'BASE64';
idText.ContentDisposition := 'inline';
idText.Body.Text := 'Text ....';
end;

if FileExists(FileToSend) then
begin
if not assigned(Attachment) then
begin
Attachment := TidAttachmentFile.Create(EMessage.MessageParts, FileToSend);
Attachment.FileName := FileToSend;
Attachment.ContentType := 'application/pdf';
end;
end;

idSMTP.Host := xxx;
idSMTP.Username := xxx;
idSMTP.Password := xxx;

try
idSMTP.Connect();
idSMTP.Send(EMessage);
idSMTP.Disconnect;
idSMTP.Free;
idText.Free;
if Assigned(Attachment) then Attachment.Free;
EMessage.Free;

except on E : Exception do
begin
if idSMTP.connected then try idSMTP.disconnect; except end;
....
end;
end;
....

Luckie 6. Mär 2012 10:33

AW: Pdf Datei als Anhang Indy 10
 
Das ist ein bekanntes Outlook Problem. Google mal nach Outlook und Anhang und dat.

mario-g 6. Mär 2012 11:06

AW: Pdf Datei als Anhang Indy 10
 
Hi Luckie,

andere gesendete Pdf-Datei, werden aber nicht umbenannt. Nur, wenn ich eine PDF-Datei aus meinem Programm versende.
Da sollte doch kein Unterschied sein oder?

ibp 6. Mär 2012 13:34

AW: Pdf Datei als Anhang Indy 10
 
hatten wir vor kurzem schon mal hier...Email mit Outlook

mjustin 6. Mär 2012 13:36

AW: Pdf Datei als Anhang Indy 10
 
Oft hilft es, auf die neueste Version von Indy umzustellen. Die Komponenten müssen dazu nicht unbedingt in der IDE installiert werden - es genügt, Lib/Core, Lib/System und Lib/Protocols in den Projektsuchpfad aufzunehmen.

mario-g 6. Mär 2012 13:49

AW: Pdf Datei als Anhang Indy 10
 
Artikel "Email mit Outlook" gelesen und eingestellt - hilft nicht.
Werde mal die neusten Indy holen und einbinden.
Danke für Eure Antworten.


Alle Zeitangaben in WEZ +1. Es ist jetzt 04:47 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