Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to initiate/send SMS from a HTML5 webpage using devices native functions?

I am wondering how can I open the send SMS application by using a web control of a HTML5 page on Android and iPhone. I want to use the device native SMS sending app, with a prepopulated value from the web.

like image 809
Pentium10 Avatar asked Apr 19 '11 19:04

Pentium10


People also ask

How do I use HTML for SMS?

Making an SMS link is very easy in HTML. Here, we will see how to make the SMS link on a webpage. Approach: Using <a> href attribute: Enter the phone number in place of the URL and add sms: before it to make an SMS link. Add the text between the tags that will appear as the clickable link.

How do I send a message in HTML?

HTML Email Tag HTML <a> tag provides you option to specify an email address to send an email. While using <a> tag as an email tag, you will use mailto: email address along with href attribute. Following is the syntax of using mailto instead of using http.


1 Answers

Further to other answers I can confirm that smsto:555:bodytext does not work on an iPhone running iOS5.

What does work (and I've tested it) on Android is the format:

sms:444?body=hello

Example:

<a href="sms:444?body=hello">Tap to say hello!</a>

On iPhone the ?body=hello will prevent it working at all, and you should use just sms:555 instead.

sms:555

Example

<a href="sms:444">Tap to text us!</a>
like image 146
Ben Clayton Avatar answered Sep 20 '22 01:09

Ben Clayton