首页 > 其他 > 详细

16模块-messaging【发送短信】

时间:2018-07-18 13:32:31      阅读:190      评论:0      收藏:0      [点我收藏+]
Messaging模块管理设备通讯功能,可用于短信、彩信、邮件发送等。通过plus.messaging可获取设备通讯管理对象。另外也可以直接通过html中的href直接快速发送短信、拨打电话、发送邮件等。

 

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<title>心得</title>
<script type="text/javascript">
function one(){
var msg = plus.messaging.createMessage(plus.messaging.TYPE_SMS);
msg.to = [‘要发送的手机号码‘];
msg.body = ‘要发送的内容‘;
plus.messaging.sendMessage(msg,function(){
alert(‘发送成功‘);
},
function(e){
alert(‘短信发送失败:‘+e.message);
});
}
</script>
</head>
<style>
#map{position: fixed;top: 200px;left: 0px;width: 100%;height:300px;}
</style>
<body>
<div onclick="one()" style="height:40px; line-height: 40px; border:#ccc dashed 1px;">发送短信</div>
</body>
</html>

 

16模块-messaging【发送短信】

原文:https://www.cnblogs.com/xhrs/p/9328255.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!