How to send SMS from mobile browser

1.5k views Asked by At

I'm looking for a method to send an SMS from a mobile browser. Currently I have a link:

<a href = 'some thing..'>Send SMS to Me</a>

The idea is, if the user clicks on the above link, a SMS is automatically sent to my phone, from the user's phone.

Note : I had tried <a href = 'sms:9xxxxxx?body...'> but its asks the user to confirm if they want to send an SMS. Does anyone have any ideas for this?

3

There are 3 answers

1
Repox On BEST ANSWER

I don't think its possible without actually getting the users consent - imagine a solution where a website could get the phonenumber of any smartphone without the client allowing it? Sounds like a great start for a malicious use.

Your only possibility, besides building a web app to which the still has to insert his phonenumber manually, is embracing the fact that you reached a barrier that has been put there for your (and everyone else's) security and privacy.

0
Jasonw On

One way of doing it is that, <a href = 'localhost/sms'>Send SMS to Me</a> this http link will probably send to the server and that server jsp or servlet should send the sms to you.

0
jbjon On

The sms: prefix in an anchor link can lead to the mobile phone's own SMS application to be activated and the SMS is the prompted to be sent from their mobile phone, as you say.

That method means you could prompt the user to send an email FROM their number TO your prefixed number in your HTML.

The alternative is to prompt the user to enter their mobile number on your website and then submitting that to your server you could use an SMS Gateway to send an SMS to them.

It's not clear from your question which direction you want messages to flow from and to but you'd get a more consistent result from sending the SMS from your web server via an SMS Gateway because then it wouldn't matter what kind of browser it was.