满友短信接口调用JAVA代码
1、在Java项目中的lib引入mysms1.6.jar,直接拷贝进去都行。

2、创建一个Java类,命名自己定义并导入jar包中的接口类请看代码:
import com.mysms.sdk.SendMsg;
3、创建方法并调用,见代码:
public static String SmsTest(String sendUrl, String account,String password,String mobile,String content){
return SendMsg.sendBatch(sendUrl, account, password, mobile, content) ;
}
4、用main方法测试
public static void main(String[] args) {
String httpUrl = "http://sdk.shmyt.cn:8080/manyousms/sendsms";
String result= SmsTest(httpUrl, "account", "password", "mobile", "您的验证码是:4875【满友科技】");
System.out.println(result);
}
调用正常是会返回一串json字符串例如:
{codetype :0,sendmsgid:1001030015349555800 }
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
                                阅读量:163
阅读量:112
阅读量:86
阅读量:67
阅读量:73