7 Years
Discussion Span
Last Post by trilok31

1. SMS is not sent from e-mail

2. Before asking for code you need to show effort and post the code that you are working on.

3. Does you project included any database operation ? If yes -- which DB ? How you connect VB to DB ?

Edited by debasisdas: n/a


sorry.... sms from free-sms website ..

Dim modem As SMSModem
Set modem = New SMSModem
modem.LogTrace = True
modem.OpenComm gsmModemCustom, 110279, , smsNotifyNone
Call modem.SendTextMessage(9677021112#, hi)

error is run time error 6 overflow


sms from free-sms website

I don't think there is a free sms provider.

I am also not that versed in gsm. I am using "Clickatel" which is probably one of the best services available. When you download their drivers and sdk, it gives you 5 free sms's to test your app. The main NICE thing is that they give you FULL code samples for vb6 as well, which works perfect. Unfortunately, after 5 attempts, you need to buy more credits/sms time.

Just go to their site and download all you need.:)


Show some effort and search the site.

This is the link to the download site and then select the following option -

* COM Object API
Popular with windows-based developers, the Clickatell COM API's rich set of methods and definitions make it easy for a user to integrate SMS sending into their programs or ASP pages . Sign up.

You need sign up first before you can download the com api. Once done, download and then go into the folder. There is a folder called vb6. Inside is a full application written in vb6 WITH commented code to help you set it up.:)

This is now solved, please mark it as solved, thanks.


i also use to send sms to students that are stored in csv file, but i dont use and free service or windows api, i just purchased bulk sms service and use there api to send sms
code goes like this...

Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim PathtoTextFile As String
Dim PathtoMDB As String
Dim myarray() As Variant

Public URL As String
Public oHttpReq As XMLHTTP30

Public oXMLDoc As DOMDocument30

Private Sub cmdbalance_Click()
URL = "" & userid.Text & "&pwd=" & pw.Text & ""
MakeRequest ("False")
End Sub

Private Sub cmdok_Click()
If rs.State = adStateClosed Then Exit Sub
tt = rs.RecordCount
ans = MsgBox(Replace(txtsms.Text, "<ARG1>", rs.fields(1).Value), vbYesNo, "SEND MESSAGE SAMPLE")
If ans = vbYes Then
Do While Not rs.EOF
        'URL = "<url to send sms>"
    'temporary codes for textin
    URL = "" & userid.Text & "&password=" & pw.Text & "&message=" & Replace(txtsms.Text, "<ARG1>", rs.fields(1).Value) & "&mobileno=" & rs.fields(0).Value & "&masking=" & sendergsm.Text
   'URL = "" & userid.Text & "&pwd=" & pw.Text & "&ph=" & rs.fields(0).Value & "&sndr=" & sendergsm.Text & "&csndr=" & sendercdma.Text & "&text=" & Replace(txtsms.Text, "<ARG1>", rs.fields(1).Value)
    MakeRequest ("False")
End If
End Sub

Private Sub Command1_Click()

End Sub

Private Sub File1_Click()
If cn.State = adStateOpen Then cn.Close
If rs.State = adStateOpen Then rs.Close
rs.CursorLocation = adUseClient
Set dg.DataSource = rs
'  MsgBox rs(0)

  '============================method 1=================================
  cn.open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
          "Data Source=" & PathtoTextFile & ";" & _
          "Extended Properties=""text;HDR=YES;FMT=Delimited"""
  rs.open "select * from " & File1.FileName & "", _
          cn, adOpenStatic, adLockReadOnly, adCmdText
  '============================method 2=================================
  'cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
          "Data Source=" & PathtoMDB & "Northwind.mdb"
  'rs.Open "SELECT * FROM [Text;Database=" & PathtoTextFile & ";" & _
          "HDR=YES;FMT=Delimited].[textfile.txt]", _
          cn, adOpenStatic, adLockReadOnly, adCmdText


End Sub

Private Sub Form_Load()
PathtoTextFile = App.Path
  PathtoMDB = "C:\PathtoMDB\"
'  CmdOpen.Caption = "Open textfile and display field value"
 ' CmdInsert.Caption = "Insert textfile values into MDB"
End Sub

Private Sub sendergsm_KeyPress(KeyAscii As Integer)
'If KeyAscii >= 97 And KeyAscii <= 122 Then KeyAscii = KeyAscii - 32
End Sub

Private Sub txtsms_Change()
Label1.Caption = 160 - Len(txtsms.Text)
End Sub
Public Sub ProcessResponse()

    ' Receive the response from the server.

    Dim str As String

    'Set oXMLDoc = oHttpReq.responseXML

    str = oHttpReq.responseText

    'MsgBox str

    List1.AddItem str

End Sub
Private Sub MakeRequest(ByVal isAsync As Boolean)

    Set oHttpReq = New XMLHTTP30

    Dim xhrHandler As myHttpRequestHandlers

    Dim data As String


    If isAsync = True Then

        Set xhrHandler = New myHttpRequestHandlers


        ' Set a readyStateChange handler.

        oHttpReq.OnReadyStateChange = xhrHandler

    End If


    'URL = ""

    'MsgBox URL
    ' Open a connection and set up a request to the server.

    oHttpReq.open "POST", URL, isAsync ', "gurmukh", "dhbe34ds"

    ' Send the request to the server.

    Dim str As String

    'On Error Resume Next


    ' In a synchronous call, we must call ProcessResponse. In an

    ' asynchronous call, the OnReadyStateChange handler calls

    ' ProcessResponse.

    If isAsync = False Then


    End If

End Sub

so find some bulk sms service provider and the will provide you there http api with that you can push sms easly

URL = "" & userid.Text & "&password=" & pw.Text & "&message=" & Replace(txtsms.Text, "<ARG1>", rs.fields(1).Value) & "&mobileno=" & rs.fields(0).Value & "&masking=" & sendergsm.Text
   'URL = "" & userid.Text & "&pwd=" & pw.Text & "&ph=" & rs.fields(0).Value & "&sndr=" & sendergsm.Text & "&csndr=" & sendercdma.Text & "&text=" & Replace(txtsms.Text, "<ARG1>", rs.fields(1).Value)
    MakeRequest ("False")
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.