Welcome to WebmasterWorld Guest from 54.159.24.159

Forum Moderators: incrediBILL

Message Too Old, No Replies

Website link to open sms

     
7:49 pm on Feb 13, 2011 (gmt 0)

Preferred Member

5+ Year Member

joined:Aug 30, 2007
posts: 559
votes: 3


Hi, can anyone help?

I would like to add a 'link' to a webpage that when clicked on a mobile phone it opens a sms message to send.. (this I can do)... BUT I would like to be able to add a message or the website url within that text message and for it to already be there when the sms opens up.

This opens up a sms on my mobile... and shows the text "Send sms" on the webpage. BUT this also comes up with a page error if clicked on by anyone using a desktop...

<a href="sms:?body=hello world">Send sms</a>

Does anyone know the code as to how to do this?
8:10 pm on Feb 15, 2011 (gmt 0)

Administrator from US 

WebmasterWorld Administrator incredibill is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Jan 25, 2005
posts:14624
votes: 88


This is going to be harder than you think, check out the SMS compatibility table on this page for various mobile browsers:
[answers.oreilly.com...]

The problem with the desktop machines is there is no SMS gateway available to the browser.

You would need some SMS API service like [clickatell.com...] to send via HTML on a desktop and that'll cost you about $0.025 per message. Alternatives would be directly connecting to SMS services on your server via a POST message and some server side code which would then work whether it was mobile or not, but your site might incur those costs unless you can find a free gateway.