Skip to Content
0
Former Member
Jan 17, 2008 at 09:57 AM

How to remove a Attachment in Module for Mail Adapter

44 Views

Hi together,

we are trying to remove a Mail Attachment within a outgoing Mail with the help of a new Module executed by the Mailadapter. Since we are using the XI 3.0, we are trying to do that by this statements:

...

Message msg = (Message)inputModuleData.getPrincipalData();

Iterator it = msg.getAttachmentIterator();

Payload payload;

do

{

payload = (Payload)it.next();

if(payload.getName().equalsIgnoreCase("MailMessage"))

{

it.remove();

}

}while(it.hasNext()); ...

The statement "it.remove" doesn't work.

Does anyone have an idea, how we can remove the attachment?

Thanks & Regards

Thomas