Hallo, ich verwende BDS2006 und Indy10 und möchte eine Mail mit einem Text und einer Datei als Anhang versenden. Wenn ich nur NUR ein Attachment versende, funktioniert es und im Outlook wird die Mail mit Anhang dargestellt. Wenn ich zusätzlich noch Text versende, habe ich keinen Anhang mehr sondern Text wie:
This is a multi-part message in MIME format --5mk7kgf3nwOM7kg5I1tkFg9kYfkb=_uMbJ Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Testmail, sollte mit Anhang sein --5mk7kgf3nwOM7kg5I1tkFg9kYfkb=_uMbJ Content-Type: application/octet-stream; name="logdatei.txt" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="logdatei.txt" dGVzdGxvZ2RhdGVpIHp1bSB2ZXJzZW5kZW4= --5mk7kgf3nwOM7kg5I1tkFg9kYfkb=_uMbJ--
Hier ein Codeschnipsel:
IdMsgSend.From.Text := vonMail;
IdMsgSend.Sender.Text:= vonMail;
IdMsgSend.ReceiptRecipient.Text := '';
IdMsgSend.ReplyTo.EMailAddresses := vonMail;
IdMsgSend.Subject := Betreff;
IdMsgSend.BccList.EMailAddresses := anMail+';';
// Message nur plain Text (kein html)
with TIdText.Create(IdMsgSend.MessageParts, nil) do begin
ContentType := 'text/plain';
Body.Text := Nachricht;
end;
// Datei anhängen
TIdAttachmentFile.Create(IdMsgSend.MessageParts, Anhang);
Was mache ich falsch? Danke
This is a multi-part message in MIME format --5mk7kgf3nwOM7kg5I1tkFg9kYfkb=_uMbJ Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Testmail, sollte mit Anhang sein --5mk7kgf3nwOM7kg5I1tkFg9kYfkb=_uMbJ Content-Type: application/octet-stream; name="logdatei.txt" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="logdatei.txt" dGVzdGxvZ2RhdGVpIHp1bSB2ZXJzZW5kZW4= --5mk7kgf3nwOM7kg5I1tkFg9kYfkb=_uMbJ--
Hier ein Codeschnipsel:
IdMsgSend.From.Text := vonMail;
IdMsgSend.Sender.Text:= vonMail;
IdMsgSend.ReceiptRecipient.Text := '';
IdMsgSend.ReplyTo.EMailAddresses := vonMail;
IdMsgSend.Subject := Betreff;
IdMsgSend.BccList.EMailAddresses := anMail+';';
// Message nur plain Text (kein html)
with TIdText.Create(IdMsgSend.MessageParts, nil) do begin
ContentType := 'text/plain';
Body.Text := Nachricht;
end;
// Datei anhängen
TIdAttachmentFile.Create(IdMsgSend.MessageParts, Anhang);
Was mache ich falsch? Danke
Comment