I develop for windows mobile 5.0 for send and receive SMS. first i send the SMS is fine worked. After i received the SMS using MessageInterceptor, after receiving SMS i am not able to send SMS, SMS sending error. give me a hint
IN Form load MsgInterpret.MessageReceived += new MessageInterceptorEventHandler(MsgInterpret_MessageReceived);
void MsgInterpret_MessageReceived(object sender, MessageInterceptorEventArgs e) { try { ReceiveMsg = (SmsMessage)e.Message; sndrNo = ReceiveMsg.From.Name; Msgbody = ReceiveMsg.Body; label2.Text = sndrNo; textBox1.Text = Msgbody; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void Send_btn_Click(object sender, EventArgs e) { try { string mAtmId = "Hello Raja" SmsMessage sms = new SmsMessage(); sms.Body = mAtmId; sms.To.Add(new Recipient(Txt_PhoneNo.Text.Trim())); sms.Send(); MessageBox.Show("Message send successfully"); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
The problem is, send the sms properly before using the MsgInterpret.MessageReceived event to receive the sms, after that to send the sms i got the error. give me an idea.