Tuliptromper:
Thanks for the explanation. I've since found that the CC3000 currently does not have peek functionality. Until I find an alternative I just won't be able to check the status codes. I'll also check out mistergreens recommendation. Thanks for the help.
Here's my code if you need it. I'm using POST, you can use GET with modification.
arduino_mail.php
<?php
$to = $_POST['to'];
$subject = $_POST['subject'];
$txt = $_POST['txt'];
$key = trim($_POST['key']);
$headers = "From: from@email.com". "\r\n";
//don't let mail function open for spam without key
if($key == "secretpasskey") {
if(mail($to,$subject,$txt,$headers)) {
echo "mail sent\n";
} else {
echo "can't send mail\n";
}
} else {
echo "wrong key: " . $key;
}
?>
Arduino code
if (client.connect("www.server.com", 80)) {
// Make a HTTP request:
char emailString[200];
char key[] = "secretpasskey";
sprintf(emailString, "to=%s&subject=%s&txt=%s&key=%s&", toEmail, in_subject, in_message, key);
client.print(F("POST /arduino_script/arduino_mail.php"));
client.println(F(" HTTP/1.1"));
client.println(F("Host: www.server.com"));
client.println(F("Content-Type: application/x-www-form-urlencoded"));
client.print(F("Content-Length: "));
client.println(strlen(emailString));
client.println(F("Connection: close"));
client.println();
client.println(emailString);
client.stop();
Serial.println("disconnect");
}
else {
// didn't get a connection to the server:
Serial.println("connection failed");
client.stop();
}