返回列表 发帖
package com.sms;

import com.wondertek.esmp.esms.empp.EMPPConnectResp;
import com.wondertek.esmp.esms.empp.EmppApi;

public class SendSMS {
        
        EmppApi emppApi = new EmppApi();
        
        RecvListener listener = new RecvListener(emppApi);
        
        String host = "211.136.163.68";
        int port = 9981;
        String accountId = "989114";
        String password = "598988";
        String serviceId = "989114";
        
        public void sendSMS(int orderFormCode, String begin_Date, String init_End_Date,
                         int init_RoomSum, String roomtype,String MPhone_Num){
               
                try {
                        //建立同服务器的连接
                        EMPPConnectResp response = emppApi.connect(host, port, accountId,
                                        password, listener);
                        System.out.println(response);
                        if (response == null) {
                                System.out.println("连接超时失败");
                                return;
                        }
                        if (!emppApi.isConnected()) {
                                System.out.println("连接失败:响应包状态位=" + response.getStatus());
                                return;
                        }
                } catch (Exception e) {
                        System.out.println("发生异常,导致连接失败");
                        e.printStackTrace();
                        return;
                }
//                发送短信               
     if (emppApi.isSubmitable()) {
                        
                        //简单方式发送短信,支持长短信
                        try{
                                emppApi.submitMsgAsync("07年好男儿冠军hallobobo");
                                
                                //同步发送方式update 20060307
                                //EMPPSubmitSMResp []  resp = emppApi.submitMsg(content,mobiles,serviceId);
                                //System.out.println("resp result:"+resp[0].getResult());
                                ////////terminate connection.
                        
                                emppApi.terminateAsync() ;

                           }catch (Exception e1) {
                                   
                                e1.printStackTrace();
                        }         
        }
        }
}

[ 本帖最后由 我爱尤那 于 2007-4-7 01:33 编辑 ]

TOP

原帖由 陨落 于 2007-4-7 10:33 发表


哈哈。。。笑色无了。。。孙权一定是被您笑死的吧。。。

我今天才发现大理石还有点文化嘛。

TOP

原帖由 陨落 于 2007-4-8 01:29 发表





从上面这句话我看出...你没有一点点挑衅的资本...

一天没来了这么激情啊。。人家加油好男儿假的?小心SMG来找你麻烦,200斤不是放来看的,是用来上ro装ry的,你上ro看到200斤的女牧师,想想就知道多恶心了。

[ 本帖最后由 我爱尤那 于 2007-4-8 16:09 编辑 ]

TOP

返回列表