title: SendGrid - Curl php external file attachment broken
body: <p>I'm using SendGrid for a customer project with curl method. </p>
  
  <p>All works fine but the(ir) file(s) attached on my email sending with SendGrid are broken. </p>
  
  <p>Here is my code : </p>
  
  <pre><code>$documentList = array(
      "DOC1.php" =&gt; "http://www.customerdomain.com/my/path/where/my/attachment/file/is/myfile.pdf"
  );
  
  
  $params = array(
                          'api_user'  =&gt; $user;
                          'api_key'   =&gt; $pass,
                          'x-smtpapi' =&gt; json_encode($json_string),
                          'from'      =&gt; $from,
                          'to'        =&gt; $to,
                          'subject'   =&gt; $subject,
                          'html'      =&gt; $mailHtml,
                          'text'      =&gt; $mailText
  );
  
  
  if(count($documentList)&gt;0){
      foreach($documentList as $fileName=&gt;$documentPath){
          $params['files['.$fileName.']'] =  $documentPath;
      }
  }
  
  $request =  $url.'api/mail.send.json';
  
  // Generate curl request
  $session = curl_init($request);
  // Tell curl to use HTTP POST
  curl_setopt ($session, CURLOPT_POST, true);
  // Tell curl that this is the body of the POST
  curl_setopt ($session, CURLOPT_POSTFIELDS, $params);
  // Tell curl not to return headers, but do return the response
  curl_setopt($session, CURLOPT_HEADER, false);
  curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
  
  
  // obtain response
  $response = curl_exec($session);
  curl_close($session);
  </code></pre>
  
  <p>When I don't have extension file on my key of array, I've a text file containing the related value.</p>
  
  <p>I think I'm not alone to have this problem, well, if you've any idea to solve this problem, thanks for your help !</p>