$from, 'to' => $to, 'subject' => $subject, 'text' => $text, 'attachment' => new CURLStringFile($attachment, $filename) ]); $response = curl_exec($curl); $status = curl_getinfo($curl, CURLINFO_HTTP_CODE); if ($status != 200) { error_log('[MAILGUN] '.$status.' '.(curl_errno($curl) ? curl_error($curl) : $response)); } curl_close($curl); ?>