send SMS

  • Thread starter Andreas Viklund via DotNetMonster.com
  • 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
 
P

Peter Foot [MVP]

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
 
A

Andreas Viklund via DotNetMonster.com

Thanks alot! It now works great.

/Andreas Viklund
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top