Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi Probleme beim versenden einer Mail mit Attachment mit Indy10 (https://www.delphipraxis.net/60350-probleme-beim-versenden-einer-mail-mit-attachment-mit-indy10.html)

hwd 5. Jan 2006 16:09


Probleme beim versenden einer Mail mit Attachment mit Indy10
 
Hallo,

ich habe ein Problem beim Vesenden einer Mail mir Delphi und Indy 10.

Ein Attachment das ich versende (eine .csv Datei) hat immer eine zusätzlice Zeile angehängt nämlich:
N¬f¢—¬±Æ§ç_¢»â®ë±¼ƒT„Œj)lz»Þr===

Ansonsten ist die Datei ok.

Der verwendete Code lautet wie folgt:

Delphi-Quellcode:
var
   SendSMTPMail: TIdSMTP;
   MailContent: TIdMessage;
   Attach: TIdAttachmentFile;
   _To: TIdEmailAddressItem;
Procedure sendmail(att:string);
begin
   // Start Mail operation;
   SendSMTPMail := TIdSMTP.Create(nil);
   sendSMTPMail.Host := 'xxxxxxx';
   sendSMTPMail.Port := 25;
   sendSMTPMail.Connect;
   MailContent := TIdMessage.Create(nil);
   MailContent.IsEncoded:=true;
   MailContent.ClearBody;
   MailContent.ClearHeader;
   MailContent.ContentType := 'multipart';
   MailContent.From.Address := 'xxxxxxx' ;
   MailContent.Subject := 'Test neu';

   // To definition
   _To := MailContent.Recipients.Add;
   _To.Address := 'xxxxxxxx';

   // Attachment definition
   Attach := TIdAttachmentfile.Create(MailContent.MessageParts,att);
   Attach.DisplayName := att;

   // Send Mail and disconnect;
   sendSMTPMail.Send(MailContent);
   sendSMTPMail.Disconnect;
end;
Wer kann helfen.

Danke.


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