You are here:

ActiveXperts.com > SMS and MMS Toolkit > Cases > BControl company

ActiveXperts SMS and MMS Toolkit Add SMS and MMS capabilities to any Windows or .NET application

CASE STUDY: Using ActiveXperts SMS and MMS Toolkit to send SMS's

Author

Fernando Benito, member of programmer team of Bcontrol Company, Madrid (Spain)

Abstract

One of our application makes the management of mobile shop. A very important aspect of this management is the customers' fidelities. This fidelities makes trough phone calls, visits and e-mails to customers. But, if we had their mobile phone number, why don't we send them notices and supplies by SMS ? Always they get permission us by send sms, of course. The example shows a way to use ActiveXperts SMS and MMS Toolkit to make a small application to send sms.

Implementation

In our application we can do a selection of customers' phone shop according many concepts: city, area, activity, employers numbers, and so on.

SMS and MMS Toolkit

After this selection, it'll show a form with a customers' list. In this form we can click in a button permit the access to sender sms application to clients:

SMS and MMS Toolkit

The Sender SMS application was created with ActiveXperts SMS and MMS Toolkit. After built the form and its controls, we have included all necessary commands for right sent of sms to all clients of the list, and we test if sms is correctly sent or, opposite the ActiveXperts SMS and MMS Toolkit had detected a error. This SMS will be saved in database for a later consult.

SMS and MMS Toolkit

The example source for this application is:

With Dta_sms.Recordset
    If .BOF And .EOF Then
        MsgBox "No hay registros para mandar SMS"
    Else
        .MoveFirst
        Do While Not .EOF
            Lbl_Send.Caption = "Mandando SMS " & (Dta_sms.Recordset.AbsolutePosition + 1) & " de " & Dta_sms.Recordset.RecordCount
            Lbl_Send.Visible = True
            Lbl_Send.BackColor = vbGreen
      
            asobj.PortID = Combo_Puerto.Text
            asobj.ModemSpeed = Combo_velocidad.Text
            asobj.ModemSettings = "8,n,1"
        
            asobj.Sender = "000000000"
            asobj.Recipient = "34" & Dta_sms.Recordset.Fields!telefono
            
            asobj.MessageText = Txt_Texto
            ' asobj.LogFile = TXT_LOGFILE
            
            ' TXT_RESULT = "Please wait..."
                        
            asobj.SendMessage False
            
    
            If (asobj.LastError = 0) Then
                dta_enviados.Recordset.AddNew
                dta_enviados.Recordset.Fields!Cif = Dta_sms.Recordset.Fields!Cif
                dta_enviados.Recordset.Fields!nombre = Dta_sms.Recordset.Fields!nombre
                dta_enviados.Recordset.Fields!telefono = Dta_sms.Recordset.Fields!telefono
                dta_enviados.Recordset.Fields!descripcion = Txt_Descripcion.Text
                dta_enviados.Recordset.Fields!texto = Txt_Texto.Text
                dta_enviados.Recordset.Fields!fecha = Date
                dta_enviados.Recordset.Fields!hora = Time
                dta_enviados.Recordset.Fields!Error = ""
                dta_enviados.Recordset.Update
            Else
                MsgBox "ERROR " & asobj.LastError & " (" & GetErrorString(asobj.LastError) & ")"
                dta_enviados.Recordset.AddNew
                dta_enviados.Recordset.Fields!Cif = Dta_sms.Recordset.Fields!Cif
                dta_enviados.Recordset.Fields!nombre = Dta_sms.Recordset.Fields!nombre
                dta_enviados.Recordset.Fields!telefono = Dta_sms.Recordset.Fields!telefono
                dta_enviados.Recordset.Fields!descripcion = Txt_Descripcion.Text
                dta_enviados.Recordset.Fields!texto = Txt_Texto.Text
                dta_enviados.Recordset.Fields!fecha = Date
                dta_enviados.Recordset.Fields!hora = Time
                dta_enviados.Recordset.Fields!Error = "ERROR " & asobj.LastError & " (" & GetErrorString(asobj.LastError) & ")"
                dta_enviados.Recordset.Update

            End If
            .MoveNext
            Lbl_Send.Visible = False
        Loop
    End If 
End Sub

Conclusion

Thanks to ActiveXperts SMS and MMS Toolkits component we has can developed our application for sms send fast and trustworthy. If I don't have this component we would built a specific module for communications between PC and mobile device, and it's suppose a important delay in the development. Sms sender applications have been tested with different mobile devices (Siemens S55, Siemens S45, Ericsson T39, Sony Ericsson T68) and all result have been satisfactory. Also we had tested a possible error for communications between Pc and mobile devices, to verify the correct operation the error's managment.

References

Bcontrol: www.bcontrol.com; e-mail: admin@bcontrol.com.