从移动浏览器发送短信 [英] sending sms from a mobile browser

查看:189
本文介绍了从移动浏览器发送短信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有从浏览器(手机)发送短信的任何更新?我见过类似的帖子关于这个主题从 这里 和< STRONG> <一个href=\"http://stackoverflow.com/questions/848575/sending-an-sms-from-mobile-browser\">here (实际上两者共享发送短信相同的方法)。

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:

&LT; A HREF =短信:+123456789体= TheMessage&GT;发送和LT; / A&GT;

当用户使用移动设备浏览和点击它会创建一个新的消息,准备发送给手机号码的链接 +123456789 与消息<$ C $上C> TheMessage 。因此,它仍然需要用户preSS发送。

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.

我要找的,用户并不需要preSS发送的方法。任何想法?

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

推荐答案

所以此工程与PHPS邮件功能,发送短信到移动。你必须知道的载体,以用于此工作的本质......每个电话号码也是它的载体内的电子邮件地址....所以我使用Verizon(我知道,他们SUX),当你给我发短信757 -757-7575,它真的发送电子邮件到我的电话号码@载体(7577577575@vtext.com)。

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).

这是很基本的,在工作演示,我甚至很难$ C $我的CD载体和数字作为输入值,尽管这可能不会是您的理想选择。

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 );

和表单标记


<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>

我想我已经做得相当猥琐地解释了这一点,所以我很抱歉,如果有任何混淆。这里的工作演示: http://dev.bowdenweb.com//php /sms/working-sms-demo2.html
我也保存为文本文件,所以你可以看到PHP结果
http://dev.bowdenweb.com//php/sms/working -SMS-demo2.txt

对不起,我不为这个在github回购可是...我应该,今天可能会做。

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

编辑:这里是用我的SMS电子邮件一个mailto演示......它通过用户的电子邮件,这实际上是相当尴尬的。不知道为什么,我想尝试...但我看到正在创建的pre-填充电子邮件之前我把它们送出去这是有益的。

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/

这篇关于从移动浏览器发送短信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆