me doing attendance project in vb... i need to send automatic SMS from e-mail to phone number...... please help me .... and post some sample codings tooo...

Recommended Answers

All 6 Replies

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 ?

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.:)

sir give the steps to do in clickatel... and necessary source codes

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()
List1.Clear
URL = "http://72.36.212.123//bal.php?usr=" & userid.Text & "&pwd=" & pw.Text & ""
MakeRequest ("False")
End Sub

Private Sub cmdok_Click()
List1.Clear
If rs.State = adStateClosed Then Exit Sub
rs.MoveFirst
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
    'http://203.212.64.15/genericpushnew/pushsms.aspx?userid=demo&password=nhn123&message=Hello%20there%20how%20are%20you&mobileno=919418450678&masking=orrery
    URL = "http://203.212.64.15/genericpushnew/pushsms.aspx?userid=" & userid.Text & "&password=" & pw.Text & "&message=" & Replace(txtsms.Text, "<ARG1>", rs.fields(1).Value) & "&mobileno=" & rs.fields(0).Value & "&masking=" & sendergsm.Text
   'URL = "http://72.36.212.123//send.php?usr=" & 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")
    rs.MoveNext
    
Loop
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
  '=====================================================================

rs.Requery

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 = "http://72.36.212.123//bal.php?usr=13421&pwd=trilok123"
   

    '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
    oHttpReq.send

       

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

    ' asynchronous call, the OnReadyStateChange handler calls

    ' ProcessResponse.

    If isAsync = False Then

        ProcessResponse

    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 = "http://203.212.64.15/genericpushnew/pushsms.aspx?userid=" & userid.Text & "&password=" & pw.Text & "&message=" & Replace(txtsms.Text, "<ARG1>", rs.fields(1).Value) & "&mobileno=" & rs.fields(0).Value & "&masking=" & sendergsm.Text
   'URL = "http://72.36.212.123//send.php?usr=" & 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")
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.