Free Information Technology Magazines and eBooks

Sunday, May 23, 2010

How To Send SMS via ELMER Server Suite Using VB.NET

How To Send SMS via Elmer Server Suite Using VB.NETSMS or Short Message Service is one of the most common used communication protocol today. It is also now widely used by companies to share information to their clients. Example of these services are product inquiries, SMS alerts, mobile banking and mobile payments. On our company, we use SMS to send wind speed alerts to managers if the wind rise up to a critical level. To setup a SMS capable system you need two components, one is a GSM modem which accepts a SIM card, and operates over a subscription to a mobile operator, just like a mobile phone. Another component is a software like eScience ELMER that will interface with the GSM modem.

For this coding tip, I will show you some custom .NET codes that can communicate with ELMER to send messages. You can use this code to start working on bigger SMS application.

Sending SMS Using VB.NET

Here is a code snippets from the VB.NET project. The code is using SendSMS.dll (it comes with the Elmer Server Suite) to send a message.


Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
Try
If btnSend.Text = "Send SMS" Then
intSMSCount = 0
If ValidateFields() Then
If Not chkRepeat.Checked Then 'Send one time only
SendSMS()
Else
tmrInterval.Interval = 1000 * nudInterval.Value
tmrInterval.Enabled = True
btnSend.Text = "Stop SMS"
End If
End If
Else
tmrInterval.Enabled = False
btnSend.Text = "Send SMS"
End If

Catch ex As Exception
MessageBox.Show("Error encountered while sending. " & ex.Message, "SMS Agent")
End Try
End Sub

Private Sub SendSMS()
Try
Dim SendSMS As Object = CreateObject("SendSMS.Send")
SendSMS.SendSMS(txtCellNo.Text.Trim(), txtMessage.Text.Trim(), 1)
intSMSCount += 1
UpdateStatus()
Catch ex As Exception
MessageBox.Show("Error encountered while sending. " & ex.Message, "SMS Agent")
End Try
End Sub


Download SMS via ELMER Project


For More Coding Tips & Tricks, subscribe now.

6 comments:

Anonymous said...

this doesn't work for me. is there any modification should i do before test this?

Nitin said...

Its didnt work for me. please help me to get read of that. i got the error that activex can not be created from send SMS function

Fryan Valdez said...

@nitin
Hi. Do you have the SendSMS.dll (it comes with the Elmer Server Suite)?

Anonymous said...

Where do you get the elmer DLL file at and will this receive text messages as well?

Fryan Valdez said...

ELMER is a product of eScience. please visit their site here

http://www.electronicscience.com/Products_Elmer.htm

Anonymous said...

is it for free? the sendSMS.dll? how can i have that component, please share it with , so i can access and test your made program