Turn your Android Phone into a SMS Gateway

Author: | Posted in Android 16 Comments

SC20130420-205340Turing your Android phone into a SMS gateway is very straight forward. All you need is “SMS Gateway” app which is freely available at Play store. SMS Gateway app is very easy to use. Its simple and rich in features. With SMS Gateway you can do lots of things such as:

  1. Periodically checks POP3 account and send contents of new emails via SMS.
  2. Enable built-in Web Server and Send SMS by HTTP GET.
  3. Forward received SMS to an e-mail address.
  4. Forward received SMS by calling remote web Server via HTTP GET.

How to send SMS?

You can send emails by two different methods.  We will learn about both one by one.

Via Email

  1. Create an POP3 enabled email id such as [email protected]
  2. Open SMS Gateway App on your Android phone. Tap at Settings button.
  3. Check “Listen for POP3 send SMS commands” checkbox.SC20130420-233409
  4. Scroll down and tap at “POP3 Settings” button.
  5. Enter your POP3 account details e.g Server, Username, Password, Port etc
  6. “Set Mailbox scan interval in seconds” to 60.
  7. Go back to home screen of SMS Gateway and tap at Start button.
  8. Write SMS recipient’s mobile number in subject line and SMS content in email body. Make sure you are sending email in plain-text format. Otherwise, outgoing SMS will be consist of garbage text.

Via HTTP GET

  1. Open SMS Gateway app and tap at Settings button.
  2. Check “Listen for HTTP Send SMS Commands” checkbox.
  3. Scroll down and tap at “HTTP Settings” button.
  4. Note down the Port number. If you want to change the port, enter the new port number here.
  5. You can also enter password. if set, password will be required for sending SMS.
  6. Go back to home screen and tap at Start button.
  7. You can now send SMS by invoking this HTTP Request (or by simply entering URL in browser’s address bar).
    http://ip-address:portnumber/sendsms?phone=1234&text=abcd&password=mypassword
    ip-address should be replaced with the actual IP of your android device and portnumber mush be same as you set in step 4. By default it is 9090.

PHP Code for invoking HTTP GET Requests

You can invoke HTTP GET requests by many different methods. for curl, file_get_contents, http_get etc.

file_get_contents

 curl

 http_get