send SMS

  • Thread starter Thread starter Andreas Viklund via DotNetMonster.com
  • Start date Start date
A

Andreas Viklund via DotNetMonster.com

Hi!
I am trying to send SMS from my Compact Framework application but I am only
getting an External Exception: Error opening SMS. I am using a Pocket PC
that you also could use as a phone, and the OpenNETCF.Phone.SMS.

What could be wrong? This is my code:

Code:
'setup the address to use
Dim addr As New OpenNETCF.Phone.Sms.SmsAddress
addr.AddressType = OpenNETCF.Phone.AddressType.International
addr.Address = "+1234567890"

Dim smssender As New OpenNETCF.Phone.Sms.Sms
Dim messageid As Integer

'send the message
messageid = smssender.SendMessage(addr, "Hello mobile phone user")

Dim status As OpenNETCF.Phone.Sms.SmsMessageStatus
status = smssender.GetStatus(messageid)


Best regards

Andreas Viklund
 
There is a limitation in the default constructor for the Sms object in that
it requests both send and receive permissions for Sms but the Inbox app
already is open with receive permission (Only one app can open sms for
receive at a time). The workaround is to explicitly specify send only:-

Dim smssender As New OpenNETCF.Phone.Sms.Sms(SmsMode.Send)

In the latest code and hence the next release send-only will be the default
behaviour.

Peter
 
Back
Top