what's wrong ? i'm working to send sms from arduino via sms Gateway

(Use arduino mega and Ethernet shield )
this is my code {

#include <SPI.h>
#include <Ethernet.h>
// Enter a MAC address for your controller below.
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
byte mac[] = { 0xB8, 0x88, 0xE3, 0x46, 0xDA, 0xCA };
// if you don't want to use DNS (and reduce your sketch size)
// use the numeric IP instead of the name for the server:
//IPAddress server(74,125,232,128);  // numeric IP for Google (no DNS)
char server[] = "www.google.com";    // name address for Google (using DNS)

// Set the static IP address to use if the DHCP fails to assign
IPAddress ip(192, 168, 1, 90); 
// Initialize the Ethernet client library
// with the IP address and port of the server 
// that you want to connect to (port 80 is default for HTTP):
EthernetClient client;

void setup() {
// Open serial communications and wait for port to open:

 // start the Ethernet connection:

   Ethernet.begin(mac, ip, subnet, gateway);

 // give the Ethernet shield a second to initialize:

 // if you get a connection, report back via serial:
 if (client.connect(server, 80)) {
   // Make your API request:
   client.print("GET /http://api.clickatell.com/http/sendmsg?");
   client.println("Host: www.clickatell.com");
   client.println("Connection: close");
   Serial.print("Sending HHTP ");
 else {
   // kf you didn't get a connection to the server:
   Serial.println("connection failed");

void loop()

 // if there are incoming bytes available 
 // from the server, read them and print them:
 if (client.available()) {
   char c = client.read();

 // if the server's disconnected, stop the client:
 if (!client.connected()) {

   // do nothing forevermore:



when enter this url in browser received sms to my phone ??!?!?!?
but in arduino do nothing ??? why and what is wrong in my code ?

this is the url : http://api.clickatell.com/http/sendmsg?user=mohammed.athamneh&password=&api_id=3539833&to=**&text=hello

char server[] = "www.google.com";    // name address for Google (using DNS)

Why? It isn't google that you want to talk to.

   client.print("GET /http://api.clickatell.com/http/sendmsg?");

This is WRONG. The GET request is sent to the server, using http protocol. So, the http:// bit is NOT part of the GET request, and the server name isn't either.

Char server = "www.google.com"; use it for check if have connection with the internet

How to solve this problem ?

How to solve this problem ?

What problem? The problem that you are connecting to the WRONG server? I would think THAT pretty obvious. If not, well then, connect to the RIGHT server.

Change Google to api.clickatell.com

Most cell phone service also have an email to Sms gateway as well. You can email a text. You can go that route.

Most cell phone service also have an email to Sms gateway as well. You can email a text. You can go that route.

can you help me ...tell me how can do this

The most readable way to email from an arduino is to call a mail script on a web server like mail() in php.
And to email SMS depends on the phone service you're texting to like verizon is 10digitphonenumber@vtext.com.


give me example !

If you're unfamiliar with web servers, don't go there.