gpt4 book ai didi

java - 如何使用 simplewire for Java 将 SMS 从 PC 发送到手机?

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:26:53 27 4
gpt4 key购买 nike

我正在使用“simplewire”库(用于 Java),它应该能够将 SMS 从 PC 发送到移动设备。但是,我看到以下错误:

Message was not sent! Error Code: 420 Error Description: Invalid Subscriber ID or Subscriber Password.

这是我的代码示例

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 和订阅者密码?我需要一个帐户吗?

最佳答案

来自Simplewire Java SMS SDK Manual

The subscriber ID is an ID number provided to paid subscribers that gives access to all of Simplewire’s resources. The appropriate password must also be set.

关于java - 如何使用 simplewire for Java 将 SMS 从 PC 发送到手机?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4656996/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com