![]() |
Anhänge aus Email in Text Form extrahieren
Hi ich habe eine email vorliegen also als text mit header etc.
Ich würde nun gerne daraus die enthaltenen anhänge extrahieren ... hier ein beipiel wie der mir vorliegende text aussieht: Zitat:
p.s.: ich gehe diesen umweg da indy 9 die anhänge nicht als solche erkennt vieleicht habt ihr ja auch eine andere idee .. ? |
Re: Anhänge aus Email in Text Form extrahieren
push
|
Re: Anhänge aus Email in Text Form extrahieren
Code:
In der Nachricht steht doch wie sie Kodiert ist.
This is a multi-part message in MIME format
--0903a79e-42a0-49b3-bae7-4556525bd4d6 <-- Marker Content-Type: application/octet-stream; charset=iso-8859-1; name=xyz.html Content-Transfer-Encoding: base64 <-- Encoding Type Content-Disposition: attachment; filename="xyz.html" PEhUTUw+DQ0KPEhFQUQ+DQ0KDQ0KPFNUWUxFPg0NCkE6bGluayB7IGNvbG9yOiBkYXJrYmx1ZTsg dGV4dC1kZWNvcmF0aW9uOm5vbmU7IH0NDQpBOnZpc2l0ZWQgeyBjb2xvcjogcHVycGxlOyB0ZXh0 LWRlY29yYXRpb246bm9uZTsgfQ0NCkE6aG92ZXIgeyB0ZXh0LWRlY29yYXRpb246dW5kZXJsaW5l [etc.] ZSBnaGV0PzxCUj53aGVyZT88QlI+d2hlcmUgMjQ/PEJSPnUgY29taT88QlI+Y29tZSBvbjxCUj50 aGVyZSB1IHI8QlI+d290IHUgZG9pbiBlcmU/PEJSPmZpZ2h0PzwvUD4NDQo8L0JPRFk+DQ0KPC9I VE1MPg0NCg== --0903a79e-42a0-49b3-bae7-4556525bd4d6 <--- Marker Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Das ist der Text der Nachricht blablabla --0903a79e-42a0-49b3-bae7-4556525bd4d6-- <--Marker Base64, Du brauchst den Teil doch nur wieder zurückverwandeln. [edit] Warum nutzt Du nicht TidPop3.retrieve? Retrieves a message by number. function Retrieve(const MsgNum: Integer; AMsg: TIdMessage): Boolean; Parameters const MsgNum: Integer Message number to retrieve from the server. AMsg: TIdMessage Message instance where the values will be stored. Returns Boolean - True on success. Description Retrieve is a Boolean function that retrieves the message number passed as the argument and stores the result in a IdMessage component, with MIME decoding. An IdText object is created for any text parts the message has and an IdAttachment for the attachments. Aus der TidMessage kannst Du doch dann alles auslesen: List of message parts for the message. property MessageParts: TIdMessageParts; Description MessageParts is a TIdMessagePartsList used to store the TIdMessagePart components that make up the message. MessageParts can contain two TIdMessagePart descendants: TIdText and TIdAttachment. MessageParts is used when IsEncoded is set to True (on sending), or NoDecode is set to false for receiving. Grüße Klaus |
Re: Anhänge aus Email in Text Form extrahieren
Zitat:
|
Re: Anhänge aus Email in Text Form extrahieren
push
und um meine frage anders zu stellen, gibt es eine fertige komponente in die ich eine email in dieser text form reinstecke und anhänge rausbekomme ? :stupid: ot gibt es eine möglichkeit alle anhänge aus allen emails in outlook zu extrahieren ? /ot |
Re: Anhänge aus Email in Text Form extrahieren
Hallo,
bitte schau mal hier: ![]() Vermutlich hast Du ein ähnliches Problem. Prinzipiell kann TIdMessage die von die gewünschte Aufgabe erledigen. |
Re: Anhänge aus Email in Text Form extrahieren
naja mein programm klappt ja schon nur nich bei den mails die ich laden möchte ...
anscheinend sind die fehlerhaft ... egal ich mach es nun anders (mir outlook und ezdetach) danke für die mühe |
Re: Anhänge aus Email in Text Form extrahieren
Zitat:
Und da steht auch drin, wie man die Fehler eventuell umgehen/beseitigen kann. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 08:04 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