Hi,
I wrote php script to send e-mail. Now I need from my arduino uno R3 and eternet shield to start that script. I use free hosting on 000webhost. I try all day, but only what I get is Connected and similar staff, no email. I try to open php page from browser and in that case send email and work fine. Also I try to make one html page with form (textbox and Submit), and send data in that field and push Submit but nothing happened. In the best case I need to send data from arduino pin (HIGH or LOW) to my email.
connecting...
connected
Sent the http request
HTTP/1.1 400 Bad Request
Date: Mon, 13 Jan 2014 20:25:32 GMT
Server: Apache
Content-Length: 226
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.
</p>
</body></html>
disconnecting.
Thank you verry much, man ! You have beer or something if you get in Sarajevo :-).
One more question, if I want to send certain message in that e-mail for example state of button, how to do that? I want to set body message to High or Low or some random text from arduino?
My php is
<?php
header("Content-type: text/html");
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
$to = 'm.s@gmail.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From:m.s@gmail.com' . "\r\n" .
'Reply-To: milan.samardzic@gmail.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
?>
Can I in arduino write some code like
push $message= + "some text or button state"
I try to send custom message but didn't success. I alredy have predefined text in php script, now I don't know how to add/change message body. I thinking about posting data in some kind of form and when arduino click "submit" I got mail with data !?