title: Sending email with multiple attachment is not working in mule ESB using set-attachment
body: <pre><code>&lt;flow name="SendmailFlow" &gt;
      &lt;http:listener config-ref="HTTP_Listener_Configuration" path="${sendmail.path}" doc:name="HTTP"/&gt;
      &lt;!--  http:inbound-endpoint exchange-pattern="request-response"
          host="${sendmail.host}" port="${sendmail.port}" path="${sendmail.path}" doc:name="HTTP" /--&gt;
  
      &lt;logger message="logging #[payload]" level="INFO" doc:name="Logger" /&gt;
  
      &lt;json:json-to-object-transformer
          returnClass="com.rsa.esbcommons.mailsender.MailData" doc:name="JSON to Object" /&gt;
  
      &lt;foreach collection="#[payload.getAttachments()]" doc:name="For Each Attachment in MailData"&gt;           
          &lt;set-attachment attachmentName="#[payload.getFilename()]" value="#[payload.getBase64AttachmentContent()]"
              contentType="#[payload.getContentType()]" doc:name="Create Attachment" /&gt;
      &lt;/foreach&gt;  
  
      &lt;smtp:outbound-endpoint user="${smtp.user}" password="${smtp.password}" host="${smtp.host}" from="${smtp.from}" responseTimeout="10000"
          doc:name="SMTP" mimeType="text/html" transformer-refs="MailDataToEmailTransformer StringToEmail" /&gt;
      &lt;custom-transformer class="com.rsa.esbcommons.mailsender.MailResponseMessageTransformer" doc:name="MailResponseTransformer"/&gt;
      &lt;json:object-to-json-transformer sourceClass="com.rsa.esbcommons.mailsender.BaseResponse" doc:name="Sendmail response to JSON"/&gt;
  
  &lt;/flow&gt;
  </code></pre>
  
  <p>Here the issue is attachment fails when set-attachment is used in foreach loop which is given above.  This is for sending multiple attachment with email.   Can we use set-attachment in foreach loop?Please  help thanks in advance</p>