public class SendMsg2Util {
private static String url="http://gw.api.taobao.com/router/rest";
private static String appkey="xxxxxxxx";
private static String secret="xxxxxxxx";
public void sendMsg(String name,String phone,String vcode) throws ApiException{
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaAliqinFcSmsNumSendRequest req = new AlibabaAliqinFcSmsNumSendRequest();
req.setExtend("XXX");
req.setSmsType("normal");
req.setSmsFreeSignName("注册验证");
req.setSmsParamString("{\"name\":\""+name+"\",\"code\":\""+vcode+"\"}");
req.setRecNum(phone);
req.setSmsTemplateCode("SMS_11415328");
AlibabaAliqinFcSmsNumSendResponse rsp = client.execute(req);
System.out.println(phone+"]验证码:"+vcode+">"+rsp.getMsg());
}
public void sendMsg(String name,String phone) throws ApiException{
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaAliqinFcSmsNumSendRequest req = new AlibabaAliqinFcSmsNumSendRequest();
req.setExtend("XXX");
req.setSmsType("normal");
req.setSmsFreeSignName("变更验证");
req.setSmsParamString("{\"name\":\""+name+"\",\"phone\":\""+phone+"\"}");
req.setRecNum(phone);
req.setSmsTemplateCode("SMS_11535513&