I have developed code that reads, sends n delete the sms but i want it automated i.e i want whenever any message is received my code should retrieve it automatically n search the data that sms want n f/w it to the requested number... how to do this without human interaction? code is developed in vb.net, using dku5 cable n nokia pc suite 6.8!
here is sending function of my code..
Private Sub cmdsendSMS_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdsendSMS.Click
If Not SendSMS(txtNumber.Text, txtMessage.Text) Then
Call MsgBox("SMS send failed.", vbOKOnly, "SMS Error")
End If
End Sub
Private Function SendSMS(ByVal Number As String, ByVal message As String) As Boolean
SendSMS = False
On Error GoTo Error1
'Get data of first parameter set, mostly the right one
Dim params_GSM As IGSMParameters
params_GSM = GetParameterSet(1)
If params_GSM Is Nothing Then Exit Function
Dim submitObj As NokiaCLMessaging.IGSMSubmit
Dim smsEntry As NokiaCLMessaging.ShortMessageItem
'Create new short message
smsEntry = New NokiaCLMessaging.ShortMessageItem
smsEntry.Type = SHORTMESSAGE_TYPE_GSM_SUBMIT
submitObj = smsEntry.TypeProperties
submitObj.Message = message
submitObj.DestinationAddress = Number
submitObj.ServiceCenterAddress = params_GSM.ServiceCenterAddress
submitObj.ProtocolID = params_GSM.ProtocolID
submitObj.DataCodingScheme = CODING_SCHEME_TEXT
submitObj.ValidityPeriodRelative = params_GSM.ValidityPeriodRelative
MsgBox("Total Message length : " & Len(message))
'Send message
Call smsObj.SendSMS(SHORTMESSAGE_ROUTE_TYPE_ANY, submitObj)
MsgBox("Msg sent successfully")
SendSMS = True
Exit Function
Error1:
MsgBox("Source: " & Err.Source & vbCrLf _
& "ErrorDescription: " & Err.Description _
& vbCrLf & "HelpContext: " & Err.HelpContext, _
vbExclamation, "Error")
End Function



