java - 用java发送短信

标签 java web-applications sms sms-gateway

我有一个java类,用于通过java web应用程序向手机发送短信。但我没有收到以下条款,我怎样才能得到这些条款?

      String username = "MySMSUsername";// how to know MySMSUsername?
      String password = "MyPassword";//how to know password?
      String smtphost = "MySMSHost.com";//how to know SMSHost?
      String compression = "My SMS Compression Information";
      String from = "mySMSUsername@MySMSHost.com";
      String to = "PhoneNumberToText@sms.MySMSHost.com";
      String body = "Hello SMS World!";

完整源代码:How to send SMS using Java

最佳答案

您指的代码只是使用java程序发送电子邮件。而不是使用java发送短信。

String username = "saroj"; for example
String password = "saroj123";
String smtphost = "your e-mail server host name"; you can IP address of the mail server
String compression = "this is the subject of your e-mail"; 
String from = "saroj@saroj.com";
String to = "yourfreind@abc.com";
String body = "This is the actual message content";

使用java发送电子邮件时需要所有这些信息,而不是发送短信。为了发送短信,您需要配置短信网关。

关于java - 用java发送短信,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10070671/

相关文章:

c# - 通过 BTS 使用调制解调器和打印机打印

api - 短信休息服务?

amazon-web-services - AWS SNS : SMS started to fail with "Unknown error attempting to reach phone"

java - java中有类似javascript绑定(bind)的函数吗

java - 如何模拟 JPA 存储库以将其用于 Junit 测试?

PHP:如何对数组的数组执行 htmlspecialchar()?

php - 如何在PHP中应用机器学习算法?

java - Boon JSON - 更改对象反序列化的字段名称

java - 在 Java 和 C++ 之间交换对象/类数据

spring - Apache Camel Spring 配置错误 - 无法找到 XML 模式命名空间的 Spring NamespaceHandler [http ://camel. apache.org/schema/spring]