com.shovesoft.SMS.sendMSM(IConstants.SEND_PHONE_ACCOUNT, IConstants.SEND_PHONE_PASSWORD, content, userPhone);
下面的配置参数
send_phone_account=J01370
send_phone_password=635210
/** * 发送验证码到手机 *
@param userCode *
@param userPhone */
public void sendPhoneMessage(final String content,final String userPhone)
{
taskExecutor.execute(new Runnable()
{ public void run() {
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); log.info("内容:"+content+"手机号码:"+userPhone+"时间:"+sdf.format(new D
ate()));
com.shovesoft.SMS.sendMSM(IConstants.SEND_PHONE_ACCOUNT, IConstants.SEND_PHONE_PASSWORD, content, userPhone); } catch (IOException e) { log.error(e); e.printStackTrace(); } catch (ServiceException e) { log.error(e); e.printStackTrace();
} } }); } public static void main(String[] args) throws RemoteException, ServiceException { com.shovesoft.SMS.sendMSM("Test", "234234090xdvo4", "main1", "1812648035
0"); } public void setTaskExecutor(ThreadPoolTaskExecutor taskExecutor) { this.taskExecutor = taskExecutor; }
需要租用短信发送的服务器吧?