0

Is there any updates for sending sms from the browser(mobile)? I've seen similar posts on this topic from here and here (actually both share the same method of sending sms).

Anyway the method of the above links is able to CREATE a message but not send it like so:

<a href="sms:+123456789?body=TheMessage">SEND</a>

When a user is browsing with a mobile device and clicks on the link it creates a new message ready to send to mobile number +123456789 with a message TheMessage. So it still requires the user to press send.

I'm looking for a method where the user doesn't need to press send. Any ideas?

Community
  • 1
  • 1
Jo E.
  • 7,822
  • 14
  • 58
  • 94
  • 1
    This will never be possible, for security reasons! – yckart Aug 14 '13 at 14:39
  • yeah I've heard. I wish they make this happen with just a prompt telling users to allow message sending or something like that. . – Jo E. Aug 14 '13 at 14:40
  • 1
    it's "possible", but it really depends on your constraints...i have a sms php demo, that you can access in a browser (not just mobile)...you could make it more responsive, and i think you'd be good to go...sound like what you want? – albert Aug 16 '13 at 17:41
  • @albert I think yes. can I have a look please? – Jo E. Aug 17 '13 at 03:33

1 Answers1

2

so this works with phps mail function, sending sms to mobile. you have to know the carrier being used in order for this to work...essentially every phone number is also an email address within its carrier....so i use verizon (i know, they sux), when you text me 757-757-7575, its really sending an email to my phoneNumber@carrier (7577577575@vtext.com).

this is very basic, in working demo, i've even hardcoded my carrier and number as the input values, although that may not be ideal for you.

essentially here's the mail function:


  $message = wordwrap( $_REQUEST['smsMessage'], 70 );
  $to = $_REQUEST['phoneNumber'] . '@' . $_REQUEST['carrier'];
  $result = @mail( $to, '', $message );

and the form markup


<form action="" method="post">
  <ul>
    <li>
      <label for="phoneNumber">Phone Number</label>
      <input type="text" name="phoneNumber" id="phoneNumber" placeholder="7577597204" value="7577597204" /></li>
              <li>
      <label for="carrier">Carrier</label>
      <input type="text" name="carrier" id="carrier" placeholder="vtext.com" value="vtext.com" /></li>
              <li>
      <label for="smsMessage">Message</label>
      <textarea name="smsMessage" id="smsMessage" placeholder="Text Message Goes Here Yo!..."></textarea>
    </li>
    <li>
      <input type="submit" name="sendMessage" id="sendMessage" value="Send Message" /></li>
  </ul>
</form>

i think i've done quite a wretched job explaining this, so i'm sorry if there's any confusion. here's working demo: http://dev.bowdenweb.com//php/sms/working-sms-demo2.html and i also saved it as a text file so you can see the php
http://dev.bowdenweb.com//php/sms/working-sms-demo2.txt

sorry i don't have a repo on github for this yet...i should probably do that today.

edit: here's a mailto demo using my sms email...it goes through the user's email, which is actually quite awkward. not sure why i wanted to try it...but it was useful for me to see the pre-populated email being created before i send them out.

http://jsfiddle.net/jalbertbowdenii/7jFee/

albert
  • 8,112
  • 3
  • 47
  • 63
  • hello thanks for putting this script together. This form of browser to sms has actually been on the internet for quite some time now (Ive seen it a couple times too). The issue I have with this is that I cannot find my country's carriers sms gateway. If you have any information on how to retrieve the sms gateway then that would be really appreciated! – Jo E. Aug 18 '13 at 01:32
  • hmmmm. ok. i'll try and look them up...got a list of ya'lls providers? – albert Aug 18 '13 at 04:35
  • I would be amaze with your searching skills if you can find any there's 3 providers that dominate our country http://www.suncellular.com.ph/ | http://www1.smart.com.ph/corporate | http://www.globe.com.ph/ thanks for the help! – Jo E. Aug 18 '13 at 08:49
  • lol. no promises but why not? i think they are intentionally hidden, for reasons like this. they don't want you to know you can text for free. – albert Aug 19 '13 at 05:34
  • yeah I figured that would be the case. but who knows. maybe you can find them. haha – Jo E. Aug 19 '13 at 06:14