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

Pentium10 picture Pentium10 · Apr 19, 2011 · Viewed 43.9k times · Source

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.

Answer

Ben Clayton picture Ben Clayton · Feb 10, 2012

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>