I have a arduino sketch that will email a person using a php form that it calls by URL with the variables such as TO=user@domain.com&FROM=Me@domain.com
That all works
But what I want to do is take the a arduino variable from a sensor or another arduino function and use that in the Get statement
[b]int mBody = 5;[/b]
if (client.connect(serverName, 80)) {
Serial.println("connected");
// Make a HTTP request:
client.println("GET /~genxweb/armail.php?TO=reciever@gmail.com&FROM=mike@me.net&SUBJECT=Test&MESSAGE=[b]mBody[/b]&CODE=SECRET HTTP/1.0");
client.println();
digitalWrite(ledIP, LOW);
digitalWrite(ledMail, HIGH);
}
else {
// kf you didn't get a connection to the server:
Serial.println("connection failed");
digitalWrite(ledIP, LOW);
digitalWrite(ledMail, LOW);
}
}
Here is a sample where I try to assign mBody a value of 5 and try to use that variable in the client.print and it will only send it as a string and not use the value. I read somewhere that I need to use string and define it but I am still learning and I dont understand the statement. I spent the last few hours on the forums trying to figure this out with no luck.
If I was doing this in Ruby a language I know I would put #{mBody} in the string and be good. Can some one shed some light on this.
Thanks in advance.