WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: kdmoyers on July 07, 2023, 05:20:39 AM

Title: Can Postie extender get original raw contents of an email?
Post by: kdmoyers on July 07, 2023, 05:20:39 AM
I see that the  kGetMail function has parameter "r" which sounds like you are going to get the full byte stream, but then it says something about saving attachments...

What I need is the original stream of bytes, with all the headers, mime sections, attachments and everything in one contiguous block, to save as .EML file, for later processing by other software.

If that's not possible with Postie, can anyone recommend an alternate method?

Thanks!
Title: Re: Can Postie extender get original raw contents of an email?
Post by: td on July 07, 2023, 07:49:09 AM
Have you tried the "r" option? As far as I know, it puts attachments alone with all the headers and body of the message into a single file.   If you give the output file an eml extension and have an email client on your system that is mapped to that extension, you can easily verify the output file's contents. 
Title: Re: Can Postie extender get original raw contents of an email?
Post by: kdmoyers on July 07, 2023, 08:59:35 AM
Will do.  I just needed a little assurance that I had a decent chance of success.
I'll experiment!  a ten line program will tell the tale.
Thanks !!
Title: Re: Can Postie extender get original raw contents of an email?
Post by: kdmoyers on July 07, 2023, 10:13:08 AM
It worked!  I used the example code from the help file just about verbatim.

it also seemed also to return the unsectioned portion of the body as a string return value.

Thanks!