在一些网站上,会有用到手机的短信发送,一般都是调用别人的发送短信接口来发送短信。
这时需要一个手机号码:138XXXX3333和一个发送的内容(签名加模板)。
部分摘录:
if(SMSUtil.sendSMS(new String[]{phone}, null, content)){
final ServletContext application = request.getServletContext();
application.setAttribute(phone, ticketNO);
new Timer().schedule(new TimerTask() {
public void run() {
application.removeAttribute(phone);
}
}, 60000);
super.sendSuccessMessage(response, "发送成功!");
}else{
super.sendFailureMessage(response, "发送失败,请稍后再试!");
}
super.sendStatus(response, statustag);