mahdi68 -4 Junior Poster in Training

Hi i try sen sms with this code , but invalid port error shown

try {
            MessageConnection mc = (MessageConnection) Connector.open("sms://0123456789");
            TextMessage msg = (TextMessage) mc.newMessage(MessageConnection.TEXT_MESSAGE);
            msg.setPayloadText("salam");
            mc.send(msg);
            mc.close();

        } catch (IOException ex) {
            ex.printStackTrace();
        }

what is wrong in my code ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.