title: How can I attach multiple files to an ActionMailer mail object? (Without it attaching several unwanted text files as well.)
body: <p>I am successfully generating and sending an email with the following code.</p>
  
  <pre><code>class UserMailer &lt; ActionMailer::Base
    default :from =&gt; 'user@user.com',
            :date =&gt; Time.now
  
    def new_user(user)
      mail_subject = ['WELCOME TO ACME, INC', 'USER ACTIVATION']
      @user = user
  
      mail.attachments['File One.pdf'] = File.read(File.join(ATTACHMENT_DIR, 'shared', 'file_one.pdf'))
      mail.attachments['File Two.pdf'] = File.read(File.join(ATTACHMENT_DIR, 'shared', 'file_two.pdf'))
      mail.attachments['File Three.pdf'] = File.read(File.join(ATTACHMENT_DIR, 'shared', 'file_three.pdf'))
      mail.attachments['File Four.pdf'] = File.read(File.join(ATTACHMENT_DIR, 'shared', 'file_four'))
  
      mail( :to      =&gt; user.address.email,
            :subject =&gt; mail_subject.join(' ~ ').upcase )
  
    end
  end
  </code></pre>
  
  <p>However, the email contains three text documents which are identical to the content of the email body.  The view I'm using for the mailer is named new_user.text.erb.</p>
  
  <p>I suspect that for each pdf document I'm attaching, a plain text document is generated as well, the first being the actual email document body and the remaining three are attached along with the pdf documents.</p>
  
  <p>How may I attach these pdf documents without also attaching these (repeating) text documents?  Has anyone else run into this?</p>