Page 1 of 1

Email Importing

Posted: Tue Jan 11, 2022 8:40 am
by omni
We have a client that wants to import email and save the attachments.

The email text will include the information on each attachment, and there may be 1 to 6 pdf files included.

The file is a .msg file and will be sent to their windows server, a specific folder, to import. Around 2000 per week.

We are using xb2net for our email, but they do not have anything prewritten to do this, although he said I could do it.

I can manually open the msg file to read it, but not sure how to save the pdfs to our images folder.

Anybody done this before?

Fred
Omni

Re: Email Importing

Posted: Tue Jan 11, 2022 9:16 am
by rdonnay
Look at the function: Base642Bin()

Re: Email Importing

Posted: Tue Jan 11, 2022 2:14 pm
by jezda
Donnay is in right....

You can use only one xml file as 1 attachment in which you can store content of many (1,2,3,4....) pdf documents using the function Bin2Base64()...

e.g

*------content of test.xml (attachment)
<?xml version="1.0" encoding="UTF-8"?>
<eMail>
<AdditionalDocumentReference>
<DocumentType>document description</DocumentType>
<Attachment>
<EmbeddedDocumentBinaryObject encodingCode="base64" filename="Test1.pdf" mimeCode="application/pdf">JVBERi0xLjQG9ia...</EmbeddedDocumentBinaryObject>
</Attachment>
</AdditionalDocumentReference>
<AdditionalDocumentReference>
<DocumentType>document description</DocumentType>
<Attachment>
<EmbeddedDocumentBinaryObject encodingCode="base64" filename="Test2.pdf" mimeCode="application/pdf">JVBERi0xL...</EmbeddedDocumentBinaryObject>
</Attachment>
</AdditionalDocumentReference>
</eMail>
*---end xml

After then you can parsing xml document....

Using the function Base642Bin() restore original documents and save it on local computers...