Welcome![Sign In][Sign Up]
Location:
Search - SendSMS.java

Search list

[J2MESMS扩展配置.rar

Description:

1、将jre文件夹复制到你本机所在的JDK下覆盖掉全部jre文件夹

2、将lib文件夹复制到你项目所在的lib,添加对应lib


import org.smslib.IOutboundMessageNotification;
import org.smslib.Library;
import org.smslib.MessageEncodings;
import org.smslib.MessageProtocols;
import org.smslib.OutboundMessage;
import org.smslib.Service;
import org.smslib.modem.SerialModemGateway;
import java.util.List;


public class SendSms {
    public SendSms() {
    }


    public void sendSMS(String[] phoneNumber) throws Exception {
        Service srv;
        OutboundMessage msg;

        OutboundNotification outboundNotification = new OutboundNotification();

        srv = new Service();
        SerialModemGateway gateway = new SerialModemGateway("modem.com1",
                "COM1", 9600, null, null);
        gateway.setInbound(true);
        gateway.setOutbound(true);
        gateway.setSimPin("0000");
        gateway.setOutboundNotification(outboundNotification);
        gateway.setProtocol(MessageProtocols.PDU);
        srv.addGateway(gateway);

        try {
            srv.startService();

            for (int i = 0; i < phoneNumber.length; i++) {
                msg = new OutboundMessage(phoneNumber[i], "您有会议待处理,请登陆查看!");
                msg.setEncoding(MessageEncodings.ENCUCS2);
                srv.sendMessage(msg);

            }

        } finally {
            srv.stopService();
        }
    }

    public class OutboundNotification implements IOutboundMessageNotification {
        public void process(String gatewayId, OutboundMessage msg) {
            System.out.println("Outbound handler called from Gateway: " +
                               gatewayId);
            System.out.println(msg);
        }
    }


    public static void main(String args[]) {
        SendSms app = new SendSms();
        try {
            app.doIt();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
 


Platform: | Size: 1040178 | Author: idhuanghao | Hits:

[SMSjsms

Description: 控制手机发送短信程序,java开发实现!-sent cell phone text messaging control procedures, java development to achieve!
Platform: | Size: 1001472 | Author: 曹京文 | Hits:

[JSP/Javasendsms

Description: 在sun的主页上找到的基于java me开发的移动发短信,很适用。-send sms based on java me
Platform: | Size: 1024 | Author: jordonin | Hits:

[ApplicationssendSMS

Description: to send sms using gsm modem with java language
Platform: | Size: 2048 | Author: antony | Hits:

[Otherjindijavasendsms

Description: 在java语言下能够实现手机发送信息的过程-In the java language can be achieved under the process of mobile phone send a message
Platform: | Size: 216064 | Author: tom | Hits:

[JSP/JavaFetionService

Description: 移动飞信项目开发,用于开发飞信机器人或是飞信客房端-fetion sendsms
Platform: | Size: 1076224 | Author: | Hits:

[SMSSMS

Description: 电信ISAG短信发送源码 ISAG综合业务接入网关,英文全称为 Integrated Service Access Gatewa-ISAG SMS SendSMS ISAG综合业务接入网关,英文全称为 Integrated Service Access Gatewa
Platform: | Size: 1866752 | Author: 盘杰 | Hits:

[JSP/Javasendsms.ZIP

Description: senderreceive sms java file to send the sms
Platform: | Size: 1024 | Author: kashinath | Hits:

CodeBus www.codebus.net