How to send SMS from my website? Only sending SMS is required, not receiving
Answer 1: This is a pretty nice sms API: http://www.clockworksms.com/
Answer 2: This isn't an API solution, but more of an overview how you can quite easily build your own solution with PHP5. To send an sms to a phone, all you have to do is email the message to the phone number. The email address is just the phone number and carrier domain.
- Determine Carrier
- Determine domain for carrier
- Construct email address
- Send email
Determine Carrier The carrier can be determined by the area code and first 3 numbers. I don't know any APIs off the top of my head (I'm sure they exists though), but if you wanted to go the custom route you can sort of build your own. For example, this site has an input where you can determine carreir: http://www.telcodata.us/search-area-code-exchange-detail
But it's just posting the data, so you can figure it out by passing your own parameters. for example: ww.telcodata.us/search-area-code-exchange-detail?npa=323&exchange=249
Determine Domain Each carrier has their own domain for text. For example, AT&T is @txt.att.net while Verizon is @vtext.com.
Here is a list of carrier domains: http://www.emailtextmessages.com/
Construct Email Example: if an AT&T number is (510) 123-4567 you can send an sms to the number by emailing [email protected].
yuvraj
Updated on November 13, 2021Comments
-
yuvraj over 2 years
I want to send SMS to a group of phone numbers in my database, from my website.
Can you please guide me on how to do it, which are the best and reliable SMS api in php which I can integrate?
I want to send SMS only in India, if anyone has experience in this please do reply.
-
Lenwood over 11 yearsYour second solution is very interesting. I just did a quick search and found a handful of services that offer API carrier lookup. This actually looks like a nicer solution than the paid SMS services, unless you need to send SMS messages in bulk.
-
Bryan over 10 yearsI know this is old, but i thought it'd be useful to point out determining a carrier is not possible in every case. I brought my phone number with me from att to verizon, so determining my carrier using the area + n numbers doesn't work.
-
Bad Programmer over 10 years@Bryan: Good point. If a user ports their phone number, you can't always tell which carrier they currently use. I'm curious: what percentage of mobile users have a ported number that originated with a different character.
-
Etienne Dupuis over 10 yearsWhat if you skip step 1 and 2 and send the email to all carriers? Wrong carriers would ignore you and you're sure to hit the right one. My concern is, would they eventually ban you for sending bad numbers?
-
AuroraBlaze almost 9 years@Bad Programmer: I am currently making a research on android sms, sms gateways etc. I would like to know if charges will be applied to the receiver of the sms for Answer 2? Thank you.