title: How do I send an email with an attachment in CakePHP 2.0?
body: <p>I'm trying to send an email with an attachment using CakePHP 2.0.</p>
  
  <p>The file is submitted by the user via a form.</p>
  
  <p>So far I have:</p>
  
  <pre><code>App::uses('CakeEmail', 'Network/Email');
  $email = new CakeEmail();
  $email-&gt;attachments = array($this-&gt;data['Opportunity']['resume_file']['tmp_name']);
  $email-&gt;viewVars(array('name' =&gt; $this-&gt;data['Opportunity']['name']));
  $email-&gt;template('application')
      -&gt;emailFormat('html')
      -&gt;to(TEST_CONTACT)
      -&gt;from(EMAIL_CONTACT)
      -&gt;subject('New application received')
      -&gt;send();
  </code></pre>
  
  <p>The email sends and looks fine, but there is no attachment.</p>
  
  <p>What am I doing wrong?</p>