Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
burgercho
Posts: 10
Registered: ‎08-12-2010
My Device: Not Specified
Accepted Solution

SMS message won't send

[ Edited ]

I'm trying to send a message from a vector of numbers, everything works fine in the simulators but when i try it on a real device (9630) nothing happens (no exceptions thrown either). I've tried with and without port numbers and am running out of ideas, any help would be greatly appreciated, thanks. Here is my code (there is a loop surrounding this incrementing i):

 

 

_conn = (MessageConnection)Connector.open("sms://"+_cntctsNmbrs.elementAt(i)+":0");
				final TextMessage msgOut = (TextMessage) _conn.newMessage(MessageConnection.TEXT_MESSAGE);
				msgOut.setPayloadText(frmtdMsg);
				_conn.send(msgOut);
				_conn.close();

 

 

Please use plain text.
Developer
xshadow
Posts: 59
Registered: ‎10-26-2008
My Device: Z10

Re: SMS message won't send

If you're sending a couple of messages, try to add 1 minute delay between them.

 

Also try this method:

 

DatagramConnection dgConn; 
dgConn = (DatagramConnection)Connector.open("sms://" + _cntctsNmbrs.elementAt(i));
byte[] data = "MessageBody".getBytes();
Datagram dg = dgConn.newDatagram(dgConn.getMaximumLength());
dg.setData(data, 0, data.length);
dgConn.send(dg);
Please use plain text.