title: How to attach a file in body of email using spring integration
body: <p>I have a situation where I need to attached file in the body of the email rather than in the header. For example in Microsoft outlook if message type set to Rich Text one can drag and drop file in the body of email as an attachment. How do I do that using Spring Integration MessageBuilder?? so far this is I am using to send attachment but file attached to email in header not in body.</p>
  
  <pre><code>Message&lt;?&gt; msg = MessageBuilder.withPayload("")
  .setHeader(MailHeaders.SUBJECT, subject )
  .setHeader(MailHeaders.ATTACHMENT_FILENAME, args[0].toString())
  .build();
  </code></pre>
  
  <p>If someone give me code example would be great help! Thanks in advance</p>