tags:

views:

56

answers:

1

can i send sms using socket in php?i have mysmsmantra api..

+1  A: 

After had took a look at API documentation link provided by maggie, to send an SMS you must do an HTTP call to a specific URL containing your credentials.

If you try to implement MySMSMantra API using socket you need to recreate (at least partially) the HTTP stack... so yes it's possible - near everything is possible ;-) - but it's a nonsense.

It's way more simpler to use the available HTTP api in PHP: http://php.net/manual/en/function.httprequest-send.php

By looking at the php documentation sample and the MySMSMantra documentation you must be able to write code that send sms from php without too much pain.

Alois Cochard
In this case, `HttpRequest` isn't even necessary. Simply using `file_get_contents()` would be sufficient. cURL is also a popular and suitable solution.
mattbasta
Long time I didn't used PHP, thanks for pointing easier solution mattbasta !
Alois Cochard