1

I have been testing various solutions for triggering booking reminders via SMS from PHP scripts. The closest solution I found was the ability to email text messages to specific address based on the mobile phone provider, with a list of addresses listed here:

http://en.wikipedia.org/wiki/List_of_SMS_gateways

The point is it does not seam to work. I have sent a message to O2, Vodafone and Orange so far. O2 and orange, the message sent but was not received. Vodafone, the message was returned as a null address.

Has this ability been disbanded? What are the alternatives.

Walrus
  • 19,801
  • 35
  • 121
  • 199

2 Answers2

2

We currently use Clickatell to do exactly what you need. http://www.clickatell.com

Once you sign up and buy some SMS credits, something like this would work..

$postString = 'api_id=123456&user=USER&password=PASS&text=YOUR SMS MSG&to=4471234567890';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://api.clickatell.com/http/sendmsg');
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postString);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_FAILONERROR, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);

Hope that helps!

rgubby
  • 1,251
  • 10
  • 8
  • Few years on from this answer mate but thanks for posting this. Im not the OP but this has helped me greatly with my applications :) – Andy Holmes Jan 19 '14 at 17:01
1

Sending E-Mails is not a reliable way to deliver SMS.

Usually, the recipient has to pay a fee for messages delivered this way. This method has to be explicitly activated by the mobile phone subscriber in many countries. (It is definitely the case with most carriers in Germany at least and IIRC, in the UK as well.)

Use a proper SMS gateway that feeds your messages into the mobile network as if they came from a phone. The vast majority of these services (and probably all worthwhile ones) comes with a per-message fee. This question shows a few options.

Community
  • 1
  • 1
Pekka
  • 442,112
  • 142
  • 972
  • 1,088