I am a bit lost in the different encoding types, it seems I know why I prefer the Xojo framework usually
Anyway, Id be grateful for some advice: I set up a desktop project that uses a Pop3SecureSocket to scan through my emails, and if TopLinesRetrieved found some conditions to be true, I call a socket.RetrieveMessage on the mail id.
That works, and in the messageReceived event I receive the attachment.
I am only looking for XMLs, so I make a clumsy file name analysis (the workaround via text because instr sometimes gave me wrong trues; a better path would be to check the MiME type first thats all experimental!), well, and then I dont know any further. I run into XML exceptions not well formed (invalid token). I tried to read the attachment.ContentEncoding but despite what the LR says TextEncoding.Internetname seems to be read-only, so I dont know how to use the ContentEncoding string.
[code]Sub MessageReceived(id as integer, email as emailMessage) Handles MessageReceived
for q as integer = 0 to email.Attachments.Ubound
dim att as EmailAttachment = email.Attachments(q)
dim attst as string = att.Name
dim attname as text =DefineEncoding (att.name, Encodings.UTF8).totext
if attName.IndexOf(“XML”) > -1 then
dim data as string = att.data
if data<> “” then
dim enc as TextEncoding
// enc.internetName= att.ContentEncoding // does not work
data = DecodeBase64 (att.data)
dim xml as new XmlDocument(data)
end try end if end if
P.S.: @Christian Schmitz: Do you have classes that work faster? I found the toplinesRetrieved event of the built-in Pop3SecureSocket fires quite sparsely