Use ETH SMS service for sending texts abroad

The following simple website demonstratates how to send texts using the free SMS service of the ETH (you need to be member of). The core task of the website is to send a HTTP post request to the following website:

The documentation is found here:

The header data consists out of your ETH username and password, the action you want to perform, the message you want to send and some further stuff. In the following code I use the libcurl library to send the request. If you have enough permissions on your server you can install it by typing:

apt-get install php5-curl

Take a look at the code. You might ask, why I use a fixed destination number. Well the webinterface was just meant to send SMS to my phone! The service even transmits text to other countries. I don’t know whether it is working wordwide:

		'message' => $message,
		'originator' => 'auto',
		'number' => '[number]',
		'username' => '[username]',
		'password' => '[password]'

	$url =  "";
	$httpcode = PostRequest($url, $data);

		case "200":
			$feedback="message sent";

			$feedback="something went wrong";
        $feedback="enter message";

$value) $data .= "$key=".urlencode($value)."&"; curl_setopt ($ch, CURLOPT_POSTFIELDS, $data); curl_exec( $ch ); $response = curl_getinfo( $ch ); curl_close ( $ch ); return $response["http_code"]; } ?>


If you put this script on a webserver, make sure the file is not readable for other people, because it contains sensitive data! (your password)

Leave a comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.