title: How to send file as mail attachment via camel spring DSL
body: <p>I'm using Camel 2.9.x for integration purposes in our current project. One of the routes consists of two endpoints - file polling endpoint and smtp mail endpoint. Files produced by the first endpoint must be sent through smtp endpoint as attachments.</p>
  
  <p>For Camel configuration we're using Spring DSL (this actually is a requirement). Spring version is 3.1.1. Unfortunately, I've found only java dsl examples and documentation of attaching a file to a e-mail message in camel routes.</p>
  
  <pre><code>&lt;endpoint uri="file:///path/to" id="file-source"/&gt;
  &lt;endpoint uri="smtp://mail.example.com:25/?username=someuser@example.com&amp;amp;password=secret&amp;amp;to=recv@example.com" id="mail-dest"/&gt;
  &lt;route id="simplified-for-readability"&gt;
    &lt;from ref="file-source"/&gt;
    &lt;to ref="mail-dest"/&gt;
  &lt;/route&gt;
  </code></pre>
  
  <p>This config sends files as plain/text body, not as attachments (even binary files).
  Is there a way to send files as attachments without using Java dsl?</p>