Sms Sending problem

I am beginner in J2ME mobile application. I want to develop a [b]sms[/b] sending application for all Mobile Phones.[b]I have used the code is given bellow:[/b]

[code]

try {

String addr = "sms://" + phno.getString();

MessageConnection sender = (MessageConnection) Connector.open(addr);

TextMessage msg = (TextMessage) sender.newMessage(MessageConnection.TEXT_MESSAGE);

msg.setPayloadText("Hi, How are u ?");

sender.send(msg);

sender.close();

Alert sending = new Alert("Thanks","Message sent...", null, AlertType.INFO);

sending.setTimeout(Alert.FOREVER);

display.setCurrent(sending);

} catch (Exception ex) {}

/code]

It is working fine in NOKIA phones like: 7610 , 3250, e61

But is not working in,Sony Ericsson, Motorwala, LG Mobile Phones. Giving a Security Exceptions, Please Help me...

[891 byte] By [Please_Help_Mea] at [2007-11-26 16:11:26]
# 1
hey don't close the Connection immediately after sending the sms infact donot put the statement sender.close(); there at all It will work then...
RippingKinga at 2007-7-8 22:33:56 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2

HI

I have shifted the statement sender.close();

after a alert display.

But, It remains same, Giving Security Exception.

Is that any problem of any specifications?

Like: I am using cldc 1.0, midp 2.0, Wma 1.1 etc

Can you send some code on that .

Thanks.

Please_Help_Mea at 2007-7-8 22:33:56 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 3
no remove the sender.close(); statement completely the connection needs some time to send the sms .what u could do is close the connection before u are sending out a new sms.what happens now is that the connection is closed before the sms is being sent also.
pradeep_gudipatia at 2007-7-8 22:33:56 > top of Java-index,Java Mobility Forums,Java ME Technologies...