发送端口短信到任何手机? [英] Send port SMS to any mobile?

查看:60
本文介绍了发送端口短信到任何手机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个可以发送短信的Midlet.在J2me中,短信带有端口号.但我希望将其发送到任何移动设备而不指定端口号.我能做到吗?还是我可以通过SMS网关API从服务器端发送到任何手机?

I have a midlet that could send sms. in J2me the sms is with a port number. But I want it sent to any mobile without specifying the port number. Could I achieve that? Or is it possible if I send from server sider through SMS gateway API to any mobiles?

推荐答案

据我所知,如果您将端口号指定为0,它将以标准SMS的形式发送SMS,而另一部手机会接收该短信并将其放入收件箱中显示消息.

As far as I know if you specify the port number to 0, it will send the SMS as a standard SMS and the other phone will receive it and put the message in the Inbox.

String url = "sms://1234567:0";
MessageConnection conn = (MessageConnection)Connector.open(url);
TextMessage msg = (TextMessage)conn.newMessage(MessageConnection.TEXT_MESSAGE);
msg.setPayloadText("hello");
conn.send(msg);
conn.close();

希望对您有帮助!

这篇关于发送端口短信到任何手机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆