简体   繁体   中英

How to add multiple mail attachment in smtp using Mule ESB

I am trying to find out is there a way to add multiple mail attachment in smtp using Mule ESB.I know we can add attachment in Mule message, but I want a way by which we can add multiple attachment in Mule message before the message goes to the outbound smtp endpoint. Is there a way by writing Java code for multiple attachment ?

Thanks in advance....

Use the <set-attachment attachmentName="" value="" contentType="" /> element repeatedly to add several attachments to your Mule message. They should be automatically transformed into MIME attachments in the outbound email message.

So, as per David's suggestion the working solution is :-

<set-attachment value="#[message.payload]" contentType="application/zip" attachmentName="#[message.inboundProperties['originalFilename']]" doc:name="Attachment" />

where #[message.inboundProperties['originalFilename']] contains the file name from file inbound

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM