Generating a .msg file

Hello guys,

I would like to ask you, if there is any way to create/generate a .MSG file (used for Outlook e-mails) using WebMethods. I have seen just ways to create .CSV files, but this is a specific case.

Thanks in advance.

Hi Igor,

can you please explain your use case in detail please?
What will happen with this .msg file after it has been created?

Provide your webMethods version please.


Hi Holger,

we are using WM 9.12 and the use case is that we want to save the e-mail content to a file (for example you receive an order via e-mail and you want to store it somewhere on disk). The e-mail is picked by a polling notification and then processed in pub.flow:getTransportInfo, which gives a sensible e-mail structure. But I am not sure about the next step(s).



Hi Igor,

you can use pub.file:writeFile to write to a file by passing the email node as input data and just give filename.msg as the filename.

Remember to adjust WmPublic/config/fileAccessControl.cnf and reload WmPublic package.

Or you can try to convert the email into a XML structure and write this structure to disk.
pub.xml: documentToXMLString will be helping here.

Sample for a possible XML structure:

<?xml version="1.0"?>