cancel
Showing results for 
Search instead for 
Did you mean: 

How to skip all files other than .txt file in Mail Sender Attachemnt ?

former_member189387
Active Contributor
0 Kudos

Hi Friends ,

I am reading an Mail attachement and sending to R3 using PaloadSwapBean and MessageTransformBean .

I used to get attachement as .txt file , name like Ex10185.txt in one mail . In another mail Ex10186.txt like that.

If only thoses file comes then no problem .

<b> IF some times along with .txt file some .html files are coming by that time my Mail Adapter incorretly reading the .html file.</b>

<b> Please tell me how to skip those kind of attachements and read only .txt file</b>

Expecting your answers asap.

Best Regards.,

V.Rangarajan

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

You can simply use the PayloadSwapBean with

swap.keyName = Content-Type

swap.keyValue = .txt

The keyValue can be any substring of the content type (but wildcards are not allowed)

Regards

Stefan

Answers (1)

Answers (1)

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

one way:

you can write a simple adapter module that will

just check the attachments and remove all non TXT

Regards,

michal

former_member189387
Active Contributor
0 Kudos

Hi Michal,

Thanks for your reply , Sorry! I am aware of how to write adapter module. Can you please tell me how to write adapter module ?

Is there any links available or Blogs ?

I am expecting your reply asap .

Best Regards.,

V.Rangarajan