Using PHP Curl and Mailgun API to send mail with attachment using remote file

后端 未结 1 596
不思量自难忘°
不思量自难忘° 2021-01-28 13:41

I\'m using the Google App Engine (GAE) for PHP, and I\'m trying to use the Mailgun API to send a message with an attachment using CURL.

The attachment is on Google Clou

相关标签:
1条回答
  • 2021-01-28 14:25

    First, make sure you run PHP 5.5, because curl_file_create() is only supported from PHP 5.5.

    Then, try to get rid of setting headers explicitly. When the value of CURLOPT_POSTFIELDS is an array, then Curl automatically sets a header for multipart/form-data. So, get rid of this:

    curl_setopt($cl, CURLOPT_HTTPHEADER, $headers_arr);
    
    0 讨论(0)
提交回复
热议问题