title: Cannot send xlsx as attachment in Rails mailer
body: <p>I am trying to send an email containing a file attachment created by the user.</p>
  
  <pre><code>attachments[document.display_name] =  File.read(document.public_filename)
  </code></pre>
  
  <p>This works in most conditions (including .docx, but fails for .xlsx files with the error:</p>
  
  <pre><code>invalid byte sequence in UTF-8
  </code></pre>
  
  <p>I am using attachment_fu to upload the attachments, and delayed_job to defer sending the emails, however the file I am trying to attach looks ok, and I can open it successfully outside the application.</p>
  
  <p>I also saw a suggestion to change the code as follows, but it does not seem to help:
   include an extra.</p>
  
  <pre><code>    attachments[document.display_name] =  { :content =&gt; File.read(document.public_filename), :transfer_encoding =&gt; :binary }
  </code></pre>
  
  <p>How can I make the code work for all attachment types?</p>