Stephen Selvey
Stephen Selvey

Reputation: 393

href link to send text message?

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?

Upvotes: 15

Views: 31345

Answers (5)

Tnaike
Tnaike

Reputation: 39

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>

Upvotes: 1

Arctangent
Arctangent

Reputation: 1

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.

Upvotes: 0

Uday Kumar
Uday Kumar

Reputation: 54

The basic format of text messages link is

<a href="sms:...">

Upvotes: 0

Tony
Tony

Reputation: 3068

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.

Upvotes: 38

marcobiedermann
marcobiedermann

Reputation: 4923

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>

Upvotes: -1

Related Questions