Send port SMS to any mobile?

。_饼干妹妹 提交于 2019-12-11 09:29:32

问题


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?


回答1:


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();

I hope it helps!



来源:https://stackoverflow.com/questions/13225426/send-port-sms-to-any-mobile

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!