title: PHPMailer attachment type and size limit
body: <p>i have one form and i am using PHPMailer to send data from that form to my email. Users can send attachments as well, but i have one rpoblem: how to make PHPMailer to deny attachments larger than 2Mb and to allow only iamge attachments (no other types of documents)?</p>
  
  <p>This is code i using for multiply email attachments with PHPMailer:</p>
  
  <pre><code>foreach(array_keys($_FILES['fileAttach']['name']) as $key) {
  
     $source = $_FILES['fileAttach']['tmp_name'][$key]; 
     $filename = $_FILES['fileAttach']['name'][$key]; 
  
     $mail-&gt;AddAttachment($source, $filename);
  
  }
  </code></pre>