title: Mailgun send mail with attachment
body: <p>I am trying to send a mail with attachments with mailgun.
  The mail itself is fine, but it is missing the attachment.
  Also in the mailgun log it shows up fine, but the attachment array is empty.</p>
  
  <p>I replaced my credentials with example.com.
  The file is placed in a subdirectory and is readable.</p>
  
  <pre><code>$filename = 'directory/example.pdf';
  $parameters = array('from' =&gt; 'Example &lt;example@mail.example.com&gt;',
                      'to' =&gt; 'example@example.com',
                      'subject' =&gt; 'Subject',
                      'text' =&gt; 'This is just a test.',
                      'attachment[1]' =&gt; '@' . $filename);
  
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, 'https://api.mailgun.net/v3/mail.example.com/messages');
  curl_setopt($ch, CURLOPT_USERPWD, 'api:key-ThisIsJustARandomString');
  
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: multipart/form-data'));
  curl_setopt($ch, CURLOPT_POSTFIELDS, $parameters);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  
  $response = curl_exec($ch);
  </code></pre>
  
  <p>I don't get an error, this is the <code>$response</code>:</p>
  
  <pre><code>string(103) "{
      "id": "&lt;20170514122638.8820.55203.4543B111@mail.example.com&gt;",
      "message": "Queued. Thank you."
  }"
  </code></pre>
  
  <p>Within the mailgun logs no attachments are listed:</p>
  
  <pre><code>"message": {
      "headers": {
          "to": "example@example.com",
          "message-id": "20170514122638.8820.55203.4543B111@mail.example.com",
          "from": "Example &lt;example@mail.example.com&gt;",
          "subject": "Subject"
      },
      "attachments": [],
      "size": 349
  },
  </code></pre>
  
  <p>According to all documentation I found this would be the correct solution, but it is not working.</p>
  
  <p>Thanks in advance for all replies.</p>