Created
March 24, 2016 16:09
-
-
Save dshaw002/25ebaa842d45e87c16f3 to your computer and use it in GitHub Desktop.
Postman Snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header("Access-Control-Allow-Origin: *"); | |
header("Content-Type: text/html; charset=utf-8"); | |
$data = array( | |
'from' => '[email protected]', | |
'to' => '[email protected]', | |
'subject' => '', | |
'text' => "" | |
); | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, "https://api.mailgun.net/v3/sandbox4534.mailgun.org/messages"); | |
curl_setopt($ch, CURLOPT_POST, 1); | |
curl_setopt($ch, CURLOPT_USERPWD, "api:key-1fvi7s59am2-5h0-kc315f8lnblugwm6"); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, $data); | |
curl_exec($ch); | |
curl_close($ch); | |
} else { | |
echo json_encode(array("message" => "Invalid POST Data")); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment