12

Is there a link similar to <a href="tel:..."> for text messages. The behavior would be similar but instead of calling the number it would prompt the user to send a text?

Stephen Selvey
  • 315
  • 1
  • 3
  • 9
  • 5
    Possible duplicate of [SMS URL on Android](http://stackoverflow.com/questions/4787905/sms-url-on-android) – Steve Trout May 12 '17 at 21:42
  • Possible duplicate of [How to pre-populate the sms body text via an html link](https://stackoverflow.com/questions/6480462/how-to-pre-populate-the-sms-body-text-via-an-html-link) – Neeraj Kumar Oct 17 '17 at 22:40
  • If my answer resolved the question could you accept it to close the question? – Tony Apr 03 '18 at 17:01

4 Answers4

30

try using this:

 <a href="sms://+14035550185?body=I%27m%20interested%20in%20your%20product.%20Please%20contact%20me.">Send a SMS message</a>

You can use the body parameter to queue a message in the text.

Tony
  • 2,726
  • 1
  • 23
  • 32
0

The basic format of text messages link is

<a href="sms:...">
Uday Kumar
  • 54
  • 3
0

On my Mac, latest OS, simply opens Messenger and I have to type everything, phone, message, etc. Better than nothing but does not pre-load the number or message. It does deliver the message.

Is there some (html/php?) code to actually do this as with email, e.g., by looking up recipient in a directory? That would require only typing (or perhaps speaking on a phone) the message. Could do but hate to rediscover the wheel.

  • If you have a new question, please ask it by clicking the [Ask Question](https://stackoverflow.com/questions/ask) button. Include a link to this question if it helps provide context. - [From Review](/review/late-answers/31547181) – Dani3le_ Apr 20 '22 at 15:43
-2

WhatsApp provides an option to send text.

<a href="whatsapp://send?text=The text to share!" data-action="share/whatsapp/share">Share via Whatsapp</a>
marcobiedermann
  • 2,969
  • 2
  • 19
  • 31