Today I Learned - Rocky Kev

TIL you can make SMS links

POSTED ON:

TAGS:

So you can make a mailto: and a tel: link.

But did you know you can also do sms messages too?

<a href="mailto:someone@yoursite.com">Email Us at someone@yoursite.com</a>

<a href="tel:1234567890">Call me at 123-456-7890</a>

<a href="sms:1234567890">Text me at 123-456-7890</a>

CSS Tricks article about mailto

MDN about a hrefs

How to on sms numbers

I couldn't find the MDN on sms messages. Nor could I find it in the HTML Spec docs!

There is also some weird challenges:

There are two major problems with creating such links on web pages: they’re only appropriate for mobile systems, and different platforms will accept some sms: formats and ignore others. (iOS, for instance, will take a phone number after the sms: protocol, but will ignore everything – including the number – if body text is included).

You might also have to do a check if the device is a mobile device or not.

if ($detect->isMobile()) { echo '<a href="sms:">Send a message</a>'; }

via Send a SMS Text From A Link


Related TILs

Tagged:

TIL you can make SMS links

So you can make a 'mailto:' and a 'tel:' link. But did you know you can also do 'sms' messages too?

TIL you can make SMS links

So you can make a 'mailto:' and a 'tel:' link. But did you know you can also do 'sms' messages too?

TIL you can make SMS links

So you can make a 'mailto:' and a 'tel:' link. But did you know you can also do 'sms' messages too?