href link to send text message?
Asked Answered
B

5

14

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?

Berar answered 12/5, 2017 at 21:40 Comment(3)
Possible duplicate of SMS URL on AndroidProtect
Possible duplicate of How to pre-populate the sms body text via an html linkHaroun
If my answer resolved the question could you accept it to close the question?Jinni
J
35

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.

Jinni answered 12/5, 2017 at 21:46 Comment(1)
Very cool. I think this answer is underrated. I had no idea that you could do this with an <a> tag.Favors
A
1

Try using this sms formats, which have tested on mobile browser too:

<!-- With phone number -->
<a href="sms:+150000000?body=Share%20this%20message%20on%20sms">Send SMS Message</a>

<!-- Without phone number -->
<a href="sms:?&body=Share%20this%20message%20on%20sms">Send SMS Message</a>
Adrian answered 16/6, 2022 at 14:50 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Huguenot
W
0

The basic format of text messages link is

<a href="sms:...">
Walburga answered 13/5, 2020 at 16:55 Comment(0)
M
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.

Micahmicawber answered 15/4, 2022 at 19:6 Comment(1)
If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From ReviewDecimal
U
-1

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>
Used answered 12/5, 2017 at 21:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.