JAVA实现SMS短信发送(附:代码)

**先决条件:网建短信通提供了短信发送API,进入 [http://www.smschinese.cn/api.shtml](http://www.smschinese.cn/api.shtml) 进行注册**

**其次,运用httpClient相关知识,调用其接口实现短信发送,代码片段如下:**

@SuppressWarnings({ "rawtypes", "unchecked" })
  public int sendMsgUtf8(String Uid,String Key,String content,String mobiles){
      Map maps = new HashMap();
        maps.put("Uid", Uid);
        maps.put("Key", Key);
        maps.put("smsMob", mobiles);
        maps.put("smsText", content);
        String result = sendHttpPost("http://utf8.sms.webchinese.cn", maps, "utf-8");
        return Integer.parseInt(result);
  }

**短信内容可以随意编辑**

package com.jalor.sms.msgProUTF8;

import java.util.HashMap;
import java.util.Map;

/**  
 * @Title: http://www.smschinese.cn/api.shtml
 * @date 2011-3-22
 * @v
经验分享 程序员 微信小程序 职场和发展