![]() |
![]() |
#1 (permalink) |
普通会员
注册日期: 2009-07-03
帖子: 55
|
![]()
一. 概述
系统所有发送短信功能通过调用实现接口:jdmail.mobile.sms. SendSMSInterface 的send 方法进行短信发送。 jdmail.mobile.sms. SendSMSInterface接口代码结构如下: package jdmail.mobile.sms; public interface SendSMSInterface { public int send(String Phone, String Content); } 其中: Phone ―― 接收人手机号码 Content―― 短信文本内容 短信接口实现类例子: package jdmail.mobile.sms; public class TestSendSMS implements SendSMSInterface{ public int send(String sPhone, String strContent){ System.out.println("send sms mobile:" + sPhone + " content:" + strContent); return 0; } } 系统内置默认实现的短信发送类:jdmail.mobile.sms.SendSMS ,是通过标准的短信猫进行发送短信。 二. 开发步骤 1. 编写实现接口jdmail.mobile. sms. SendSMSInterface 的类,在结构方法send 中加入自己发送短信的代码。如:TestSendSMS 2. 把实现类打包成.jar 文件和相关的依赖库放在 web/webapps/ROOT/WEB-INF/lib 目录下。 3. 在系统设置 ―― 》 短信设置 的“SMS 发送实现类”项写入类的全名。 4. 重启webmail 服务器 三. 测试方法 在短信测试部分,输入测试接收手机号码和短信文本内容,点击发送测试,进行测试。
__________________
金笛邮件售前咨询和售后服务电话:010-82356575-6011,孟小姐 |
![]() |
![]() |