Email Attachment

hi all,

which service do i need to get an attachment of an email? for example i get csv file as an attachment.
i use an email port to poll for new emails.

thanks in advance
alex

Alex,

Welcome to WM Users! Please use the “Search Forums” functionality to look for answers to your questions before posting.

You need to create a Flow (or Java) service to process the attachment. You can either specify a default service for all email ports, a service for a particular email port or specify a fully qualified service name as the subject of the email.

The service you create needs to have an object input variable named “ffdata”. This variable will be populated with an io stream containing the contents of the attachment. You can convert this to a string and parse it using the pub.flatfile:convertToValues built-in service from the WmFlatFile package and the appropriate flat file schema.

See this post for additional details and an attached IS package containing an example that shows one way to accomplish this.

Mark

Hi Alex,
please provide more information on your question… what is the version of IS you are using… what is the content-type of the attachment/email… do you have custom content handler for email…

also, search wMUsers for “email ports” and you can see lot of information regarding receiving email attachments… specifically
[url=“wmusers.com”]wmusers.com

in general, you do getTransportInfo; from there get transport/email/content and pass this to streamToBytes and then bytesToString… (these are simple java svcs that you need to write yourself or will find them in the WmTransformationServices Pkg - available for download from Advantage, BP, utilities and samples section)…

Hope all this helps you resolve your issue.

  • Saurabh.