title: Add attachements to send mail in Yii
body: <p>I am fairly new to Yii. I am using YiiMail extension to send mails. I am able to send mails but unable to send attachments with it.</p>
  
  <p>I have got the following code but now knowing what that "tempName" would exactly mean?</p>
  
  <p>mycontroller-</p>
  
  <pre><code>$uploadedFile = CUploadedFile::getInstanceByName('filename'); // get the CUploadedFile
  $uploadedFileName = $uploadedFile-&gt;tempName; // will be something like 'myfile.jpg'
  $swiftAttachment = Swift_Attachment::fromPath($uploadedFile); // create a Swift Attachment
  $this-&gt;email-&gt;attach($swiftAttachment); // now attach the correct type
  </code></pre>