0

I want a mobile app to send automated SMS. This will be in VB.Net. I've searched for articles on these but they are all about PC apps accessing a GSM modem or a mobile through a COM port. Is it the same process with mobile apps on the phone (not through a PC)? If yes, and I am to treat the GSM modem as a "port", how would I connect to it? If no, are there any useful resources for this?

Yves
  • 682
  • 1
  • 6
  • 15

1 Answers1

1

Sending SMS is easy with windows mobile. You need a reference to mobile.poutlook namespace.

"Send SMS from Pocket PC, SMartphones, Windows mobile

To send an SMS Message we’ll first need to make reference to the Microsoft.WindowsMobile.PocketOutlook namespace.

Imports Microsoft.WindowsMobile.PocketOutlook

After that it’s as simple as creating a new instance of the SMSMessage class with an overloaded onstructor passing in the Recipient Mobile number and SMS text, then invoking the Send method"

Source.
Download VB code directly.

MS reference.

MS Snippet:

public void SmsMessageSend()
{
    SmsMessage smsMessage = new SmsMessage();

    //Set the message body and recipient.
    smsMessage.Body = "Would you like to meet for lunch?";
    smsMessage.To.Add(new Recipient("John Doe", "2065550199"));
    smsMessage.RequestDeliveryReport = true;

    //Send the SMS message.
    smsMessage.Send();

    return;
}

An automated VB translation of the above snippet:

Public Sub SmsMessageSend()
    Dim smsMessage As New SmsMessage()

    'Set the message body and recipient.
    smsMessage.Body = "Would you like to meet for lunch?"

    smsMessage.To.Add(New Recipient("John Doe", "2065550199"))
    smsMessage.RequestDeliveryReport = True

    'Send the SMS message.
    smsMessage.Send()
    Return
End Sub

The above is not VB as asked, but unfortunately MS does not provide the VB snippet there.

All this will only work, if you are using a windows mobile device. It will not work on windows ce devices.

You should consider your internet searches for mobile API and code. I always start with "compact framework" to get code related results only. Then I add the keywords I search for. In example: "compact framework send sms" gives a good result list that you can work on.

josef
  • 5,951
  • 1
  • 13
  • 24