diff --git a/index.html b/index.html index 893e7f8..47760c9 100644 --- a/index.html +++ b/index.html @@ -154,7 +154,7 @@ Free for personal and commercial use under the CCA 3.0 license (html5up.net/lice @@ -199,6 +199,28 @@ Free for personal and commercial use under the CCA 3.0 license (html5up.net/lice - + diff --git a/mail.php b/mail.php new file mode 100644 index 0000000..242d913 --- /dev/null +++ b/mail.php @@ -0,0 +1,23 @@ + array( + 'header' => "Content-type: application/json\r\n", + 'method' => 'POST', + 'content' => '{ + "from": "'.$_POST['email'].'", + "to": "matt.huntington@gmail.com", + "subject": "New '.$_SERVER['HTTP_HOST'].' message from '.$_POST['name'].'", + "html": "'.$_POST['message'].'" + }' + ) +); +$context = stream_context_create($options); +$result = file_get_contents($url, false, $context); +if ($result === FALSE) { echo '{ + "status":500, + "error":"could not make request to stupidmailer" +}'; } + +echo $result;