本文介绍了如何使用simplewire for Java将SMS从PC发送到移动设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 simplewire 库(适用于Java),它应该能够从PC向移动设备发送短信。但是,我发布了以下错误:
I am using "simplewire" library (for Java) which should be able to send SMS from PC to mobile. However, I am seeting the following error:
这是我的代码示例
import com.simplewire.sms.*;
public class send_text
{
public static void main(String[] args) throws Exception
{
SMS sms = new SMS();
// Subscriber Settings
sms.setSubscriberID("123-456-789-12345");
sms.setSubscriberPassword("1234");
// Message Settings
sms.setMsgPin("+11005101234");
sms.setMsgFrom("Demo");
sms.setMsgCallback("+11005551212");
sms.setMsgText("Hello World From Simplewire!");
System.out.println("Sending message to Simplewire...");
// Send Message
sms.msgSend();
// Check For Errors
if(sms.isSuccess())
{
System.out.println("Message was sent!");
}
else
{
System.out.println("Message was not sent!");
System.out.println("Error Code: " + sms.getErrorCode());
System.out.println("Error Description: " + sms.getErrorDesc());
System.out.println("Error Resolution: " + sms.getErrorResolution() + "\n");
}
}
}
我想知道如何获取订阅者ID和订阅者密码?我需要一个帐户吗?。
I want to know how to get Subscriber ID and Subscriber Password? Do I need an account for that?.
推荐答案
来自
这篇关于如何使用simplewire for Java将SMS从PC发送到移动设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!