RAM RAM Friends
At last I got time to write one of important topic here.
How to send SMS from VB6.0 via Internet
When I got this work to implement in our project, first I got very excited but when I tried to search this topic on Internet via Google etc, I had to struggle a lot to find the correct method.
Well We can send SMS from VB6.0 by two ways
- By using Internet (this method is explained Here )
- By Using Mobile Phone (Not explained here)
After long time, I finally got chance to provide download link to demo project which is below
The downloaded file is rar compressed. In case you don't have software to extract it, just download wrar320 or higher version free of cost from the internet via Google etc.
Please note: You need some valid Developer API.
Please either contact company or create an demo account to get developer API from the site, I had mentioned Below.
Download SMS Demo project Setup without code 2.67mb
Here I would try to explain HOW TO SEND SMS FROM VB via INTERNET
- The very first thing is that U need to contact to any SMS Providers (e.g. in India some are
- http://www.mysmsmantra.com/
- http://www.smscountry.com/ (click on Register now button at top)
- http://www.freesmsapi.com/ (click on Sign Up button at top)
- http://mirchsms.com/bulk_sms.html (please contact at no. provided at top or email at bottom to request to get trial sms api ). I also tested it very well, you may also refer my name to them.)
- Now get the Developer API from these SMS Providers either by purchasing account or if you want to test before purchasing then you can ask these SMS Providers to provide you a free trial account so that you can test their service)
- Below is one of the example of Developer API
- 'http://bulksms.mysmsmantra.com:8080/WebSMS/SMSAPI.jsp?username=demouser&password=399501089&sendername=DM&mobileno=919999999999&message=Hello"
- Now just use the following code in your VB program to send SMS
- Dim WinHttpReq As Object
- Dim sResult As String, strURL As String
- Set WinHttpReq = CreateObject("Msxml2.XMLHTTP")
- strURL="http://bulksms.mysmsmantra.com:8080/WebSMS/SMSAPI.jsp?username=demouser&password=399501089&sendername=DM&mobileno=919999999999&message=Hello"
- 'Replace the Message & MobileNo with the no to whom you want to send SMS
- With WinHttpReq
- .Open "GET", strURL, False
- .Send
- sResult = .responseText
- End With
- MsgBox "Status of Sent SMS is=" & sResult
- Some Important notes We should keep in mind while Sending SMS
- Check the Maximum Message Length that you can send as allowed by your SMS Service Providers
- Check whether you have to make your Message encode according to WWW standards, confirm it from your SMS Providers
- While sending data over internet/network, some letters can not be sent as it is, they need to be converted to send them to internet. e.g " &" can not be send as it, it needs to be converted to send it over internet.
- URL encoding converts characters into a format that can be transmitted over the Internet.
- For more information see following link
- Always Allow the access of your program to get connected with Internet which would be asked by the Firewall of your OS or Antivirus program else you could not send SMS
- As sending SMS may take time, you should do appropriate changes in your program to show user that your program is busy in sending SMS like change Mouse Pointer Shape from normal to HourGlass & after sending make it normal.
After long time, I finally got chance to provide download link to demo project which is below
The downloaded file is rar compressed. In case you don't have software to extract it, just download wrar320 or higher version free of cost from the internet via Google etc.
Please note: You need some valid Developer API.
Please either contact company or create an demo account to get developer API from the site, I had mentioned above.
Below is a sample which I used in my project
Private Sub cmdSMSTest_Click()
'validate information
'Message(max 160 Chars)
Me.MousePointer = 11 'Hourglass
Call SendMySMS(myMob, myMsg, True, Trim(Me.txtSMSDeveloperAPI), Trim(Me.txtSMSMobileText), Trim(Me.txtSMSMsgText))
Me.MousePointer = 0 'Default
End Sub
Public Function SendMySMS(ByVal myMob As String, ByVal myMsg As String, Optional ByVal IsTest As Boolean = False, Optional ByVal UserDeveloperAPI As String = "", Optional ByVal MobText As String = "", Optional ByVal MsgText As String = "", Optional ByVal AskToSend As Boolean = True, Optional ByVal ShowStatus As Boolean = True) As Boolean
'Here you write your code
Following is the sample code to test it--- but of course you need Developer API to use the code
Private Sub cmdSMSTest_Click()
'validate information
'Message(max 160 Chars)
If Me.chkSMSActivateService.Value = 0 Or Len(Me.txtSMSDeveloperAPI) < 1 Or Len(Me.txtSMSMobileText) < 1 Or Len(Me.txtSMSMessageText) < 1 Then
MsgBox "Please enter all setting values"
Me.txtSMSDeveloperAPI.SetFocus
Exit Sub
End If
Dim s As String
Dim myMob As String
Dim myMsg As String
s = "Enter Mobile nos separated by , then put @ now write your msg not more than 160 chars"
s = s & vbCrLf & "e.g 9971745868,9811994797@Hi this is test sms by ABM Infotech"
s = InputBox(s, , "9971745868,9811360935@Hi this is test sms by ABM Infotech")
myMsg = Mid(s, InStr(1, s, "@", vbTextCompare) + 1)
If Len(myMsg) > 155 Then
myMsg = Left$(myMsg, 155)
End If
myMob = Mid(s, 1, InStr(1, s, "@", vbTextCompare) - 1)
Me.MousePointer = 11 'Hourglass
Call SendMySMS(myMob, myMsg, True, Trim(Me.txtSMSDeveloperAPI), Trim(Me.txtSMSMobileText), Trim(Me.txtSMSMessageText))
Me.MousePointer = 0 'Default
End Sub
'myMob,myMsg, Optional IsTest,UserDeveloperAPI , MobText, MsgText,AskToSend ,ShowStatus As Boolean = True
On Error GoTo ArunKakkarErr
Dim sMobText1 As String
Dim sMobText2() As String
Dim sMobText3() As String
Dim sResult As String, strURL As String
strURL = ""
If IsTest Then
Else 'retrieve settings from db
'''SMS_IsActivate 1,0 SMS_DeveloperAPI SMS_MobileText SMS_MessageText
If UserPreferencesGetValue("SMS_IsActivate", "0") = "0" Then Exit Sub
UserDeveloperAPI = UserPreferencesGetValue("SMS_DeveloperAPI")
MobText = UserPreferencesGetValue("SMS_MobileText")
MsgText = UserPreferencesGetValue("SMS_MessageText")
End If
'To put 91 etc for more than one mobile nos
sMobText2 = Split(MobText, "=")
sMobText1 = ""
If UBound(sMobText2) > 0 Then
sMobText1 = sMobText2(1) '2nd element
End If
If Len(sMobText1) > 0 Then
sMobText3 = Split(myMob, ",")
If UBound(sMobText3) > 0 Then
myMob = ""
For i = LBound(sMobText3) To UBound(sMobText3)
If myMob = "" Then
myMob = sMobText3(i) '1st Mobile No
Else
myMob = myMob & "," & sMobText1 & sMobText3(i) '2nd, 3rd, 4th Mob No
End If
Next i
End If
End If
strURL = UserDeveloperAPI & "&" & MobText & myMob & "&" & MsgText & myMsg
If AskToSend Then
If MsgBox("Do you want to send SMS?", vbYesNo + vbDefaultButton1) = vbNo Then
Exit Sub
End If
End If
Dim WinHttpReq As Object
Set WinHttpReq = CreateObject("Msxml2.XMLHTTP")
'strURL = "http://bulksms.mysmsmantra.com:8080/WebSMS/SMSAPI.jsp?username=demouser&password=399501089&sendername=DM&mobileno=919999999999&message=Hello"
'Replace the Message & MobileNo with the no to whom you want to send SMS
With WinHttpReq
.Open "GET", strURL, False
.Send
sResult = .responseText
End With
If ShowStatus Then MsgBox "Status of Sent SMS is=" & sResult
Exit Sub
ArunKakkarErr:
MsgBox ("Sorry there is some error while sending sms" & vbCrLf & Err.Description)
End Sub
Public Function UserPreferencesGetValue(ByVal SettingName As String, Optional ByVal DefaultValue As String = "", Optional ByVal myTable As String = "UserPreferences", Optional ByVal NameCol As String = "SettingName", Optional ByVal ValueCol As String = "SettingValue")
Dim s As String
s = ""
Dim rptRs As New ADODB.Recordset
If rptRs.State Then rptRs.Close
rptRs.Open "select * from " & myTable & " where " & NameCol & "='" & SettingName & "'", Scon, adOpenStatic, adLockReadOnly
If rptRs.EOF = False Then ' if already present then return
s = IIf(IsNull(rptRs!SettingValue) = False, rptRs!SettingValue, DefaultValue)
Else ' if not present then return default
s = DefaultValue
End If
UserPreferencesGetValue = s
End Function
Public Sub UserPreferencesSetValue(ByVal SettingName As String, ByVal SettingValue As String, Optional ByVal myTable As String = "UserPreferences", Optional ByVal NameCol As String = "SettingName", Optional ByVal ValueCol As String = "SettingValue")
Dim rptRs As New ADODB.Recordset
If rptRs.State Then rptRs.Close
rptRs.Open "select * from " & myTable & " where " & NameCol & "='" & SettingName & "'", Scon, adOpenStatic, adLockReadOnly
If rptRs.EOF = False Then ' if already present then update
Scon.Execute "Update " & myTable & " set " & ValueCol & " = '" & SettingValue & "' where " & NameCol & " = '" & SettingName & "'"
Else ' if not present then insert
Scon.Execute "Insert into " & myTable & " (" & NameCol & "," & ValueCol & ") values ('" & SettingName & "','" & SettingValue & "')"
End If
End Sub
Public Sub AKakkar_Error(Optional ByVal Source As String = "")
Dim s As String
s = "Sorry for the inconvinence, There is some error"
s = s & vbCrLf & "ABM Source=" & Source
s = s & vbCrLf & "Error No=" & Err.Number
s = s & vbCrLf & "Error Description=" & Err.Description
s = s & vbCrLf & "Error Source=" & Err.Source
MsgBox s, vbCritical
End Sub
Note:::>>>> If someone need sample program, just mail me, I would like to help you.
Now after learning it you can explore it in details to get more powerful options for your programs.
Best of Luck for Programming.
NIce one
ReplyDeletehttp://www.boomadcom.com
Jai Ram Ji Ki Bhai,
ReplyDeleteCan u send a sample project in vb6.0 to send sms using internet. Plz email me at raisksunil@gmail.com.
jii
ReplyDeletecan u send me this sample code in vb6
ReplyDeletethank u
can u send me this sample code in vb6
ReplyDeletethank u
prashantp_patil@hotmail.com
hi pls send sample code in vb6
ReplyDeletesaraner2007@gmail.com
As per request I had send the demo version to all the requests.
ReplyDeleteHi
ReplyDeletecan you please send me sample code at waqarzahid80@hotmail.com
hey plz mail me ur sample code nik_0811@yahoo.co.in
ReplyDeletecan u send me this sample code in vb6
ReplyDeletethank u (gund.rajesh@yahoo.co.in)
Rajesh Gund
Dear friends , thanks for paying your interest in this blog.
ReplyDeleteI had sent demo project to Mr. Waqar,nik_0811, Rajesh.
Regarding query to Send SMS in other countries.
Hi Waqar,
I know only sites who provide their services in India only.
Please search on net/Google to find sites to provide services in your country.
You can also visit my blog where I mentioned some Indian sites.
You can consult them regarding this in your country.
hai i want also this project please send me to ponmalar2050@gmail.com
ReplyDeleteHi, I have sent the sms demo, Please follow the instructions given in mail to get proper working of project
DeleteThanks
Deletehi arun I also want this project..... please send me at iiamvin@gmail.com
ReplyDeleteHi, I have sent the sms demo, Please follow the instructions given in mail to get proper working of project
Deletehello sir i need this project code to be implemented in a VB 6.0 ...pliz help me..
ReplyDeletetaraju.88ism@gmail.com
Hi, I have sent the sms demo, Please follow the instructions given in mail to get proper working of project
Deletehello... shall u please give me this project! it wll be very much helpful for my final year project... mail ID "rajee.moorthy@gmail.com"
ReplyDeleteHi, I had sent you the demo project, you need valid developer api to use this project.
DeleteIt is nice one and i need sample program.
ReplyDeleteMy ID is sm829051@gmail.com
Hi, I had sent you the demo project, you need valid developer api to use this project.
DeleteSir, Please send me the sample project of sms through internet in vb6. my ID is : survittal@gmail.com
ReplyDeleteHi , I have just sent you the mail.
DeleteHello Arun Sir,
ReplyDeleteCan you please send this demo project on my email id naresh.thakur1987@gmail.com
Hi, I have sent you a mail few days ago
Deletethanks... my work done using yr help
ReplyDeleteYour welcome
DeletePlease send me the vb code. I have applied for free account in '1. http://www.mysmsmantra.com/'. My mail id sudda04@gmail.com
ReplyDeleteHi,
ReplyDeleteCan you please help me for Huwaei device.
I want to create SMS Automation.
hi thaks for this code but i want this project for demo so pls send me on my e-mail id
ReplyDeleteyouwithmishra@gmail.com
This comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
DeleteHi, just use split method which would split your message in array saparated by given char here is space , then you can get individual items.
DeletePlease search on net how to use Split method in vb6
This comment has been removed by the author.
DeleteCan u send a sample project in vb6.0 to send sms using internet. Please email me at muhsinkyl@gmail.com.
ReplyDeleteplz me this code on my email id :dadsleo_rana@yahoo.com
Deletepls i want the code and the demo pls email me at olusoji16@yahoo.com
ReplyDeleteHi friends I have sent the demo via mails till date to all requested queries, Soon, I would provide link to download this demo
ReplyDeletehi sirji I also want this project..... please send me at akansh.khare@gmail.com
ReplyDeleteIt's helpfull for me
Dear Arun Kakkar,
ReplyDeleteCan you please send this demo project on my e-mail address dimbil@hotmail.com
Sincerely Yours,
Bill Dimitriou
Hello!
ReplyDeleteSir Arun! i'am Self study Programmer! and i want to make a useful program! Like you! Sir Arun! Send me your Vb 0.6 code and sample SMS program...! thank in advancce!
this is mey Email Address: JC_Suribas@yahoo.com
Truely Your!
Julius Cesar Suribas
Thanks everybody for taking interest in this blog, I had sent the demo project to almost all request so far
ReplyDeleteHi Arun,
ReplyDeletePlease forward me your demo application to my mail id srini_visioninfo@yahoo.co.in
Besides that do you have any idea how we can read sms coming to our SIM and store in a database? if so kindly advise.
Hi friend,
DeleteI have just send you the demo project,
To read/get sms for your sim,
To do so, you have to take the api from the SIM Service provider to read sms coming to that particular sim & then you can use timer event to check whether any sms had come or not on you sim.
But to be practical, Generally, no SIM Service provider would provide such api due to security reasons or some other technical reasons, but yes if they provide such api, then it is very much achievable.
Please forward demo project to me at following email id
Deletesunandabang@rediffmail.com
Mr Arun Kakkar
ReplyDeleteHi I am Arunkumar Hukkeri MSc Gulbarga Karnatak today i was search for sms handling ads and i came
across your note on sms . and i found it very informative and i tried and next i will try after i get developer api as mentioned .
thanks
my mail id arunkumarbbsr@gmail.com
Hi Arun,
DeleteThanks for liking this information, I am using it & its working very fine so far. Just keep in mind mentioned instructions like DND rule, special characaters & of course valid Developer API
Hi Arun,
ReplyDeleteI'm Yuvarajan and uvan24@gmail.com is my Email ID. Please send the code to me also...
Hi Arun
ReplyDeleteI am Venkat and located in Bangalore, India.my email id is venkat_sr@hotmail.com. Can you pls send the sample project at the earliest. I urgently need to provide sms interface to my LIS application which sends sms to doctors and patients on say patient registration, critical lab values observed etc
Hi Arun can u plz send me the source code plz. I'd: startharik@gmail.com
ReplyDeleteDear Arun,
ReplyDeletePlease help me to create vb script to send SMS using data from EXCEL through Internet.
My Email ID gajendra_indora@rediff.com
Please send your sample code for this to my email id meera1990a@gmail.com
ReplyDeleteHi friends, I had sent the demo to almost all requests. Please note that, I also had provided the link to download the demo project
ReplyDeleteHello plz i want the code and the demo pls email me at upadhyaydilip@gmail.com
ReplyDeleteThanks Arun , I got demo.
DeleteThanks to all the friends to like this, I hope it would be very useful for everybody.
ReplyDeletePlease note that:
Just below the example, I also had provided the link to download the demo project
pls send the code on youwithmishra@yahoo.co.in
ReplyDeletegreat service you are doing. i want sample code
ReplyDeleteinnovative.invest2008@gmail.com
Great!.. wow!, Sir can you send me your sample demo project if it is ok with you?.
ReplyDeleteThank Your Sir!. :)
email: pnxstan23@yahoo.com
GOD BLESS :)
Hello Arun sir
ReplyDeleteI need code of sending sms through mobile.can u plz send me on callmedivyaonly@gmail.com.Its urgent
thanks
Divya
Hi friends, I had sent the demo to almost all requests. Please note that, I also had provided the link to download the demo project
ReplyDeletehello sir
ReplyDeletei need basic code of this software plz send me code deepakratnavat@gmail.com
hello to all,
ReplyDeleteI want to send sms free in vb6 please help me
Please read the blog carefully & download the demo project to get more idea,
DeleteHow to send sms on DND(Do Not Disturbed) activated no
ReplyDeleteHi Friends, after getting lot of queries on sending sms on DND nos,
To send on these nos, there are two ways,
way 1> > You have to get the format to be registered in the country law as in India, only then you can send sms on DND nos
e.g if your format is as below (approved by Govt. of your country)
Dear Customer, Your Order: XXXX despatched on xxxx. Please pay the amount after receiving it from our executive xxxxx.
In above example, you can put values in place of XXXX SO THAT YOU MAY GET your desired message.
Way 2> Ask your sms service provider to find way to send sms on DND nos.
How to send sms via mobile.
ReplyDeleteDear friends, I have not studied the process of sending sms via mobile, but if you are using internet via your mobile, you can send
sms but only using valid api not by using sms package of your mobile,
For this you need to consult your mobile connection provider, so that you can send sms via them.
hello sir i need this project code to be implemented in a VB 6.0 my mailid kmwarshini@gmail.com
ReplyDeleteHi Arun,
ReplyDeleteThis is Subramanyam , I want to use this SENDing SMS code in my Project please mail me to mY ID k_smanyam@yahoo.com
thanx in advance
send
ReplyDeleteHello,
ReplyDeleteThis is Nitin . I want to implement SMS sending application using vb 6.0. please send the code to my email id
nitinhiwase76@gmail.com
Thanks !
i want to use this SMS sending code in my project please send the code.
ReplyDeleteemail id :- rajkamal220@gmail.com
can you make an app to send sms to maldives.
ReplyDeletehttp://www.afreesms.com/intl/maldives
above url works for Maldives.
email id: thisisit431@gmail.com
thank you
sir send me on yadawraaj@yahoo.in
ReplyDeletePlease send me the code for sending SMS through mobile / internet through VB6.0 application. My email address is dani.rajiah@gmail.com
ReplyDeleteAlso suggest me the best premium / payable bulk SMS provider here in Mumbai, India.
Thanks.
Dani Rajiah
I really appreciate this post. I have been looking everywhere for this!
ReplyDeleteThank goodness I found it on Bing. You've made my day! Thank you again!
My blog :: adfoc.us
Somebody necessarily lend a hand to make severely articles I might state.
ReplyDeleteThat is the first time I frequented your
website page and to this point? I surprised with the research
you made to create this particular submit extraordinary.
Excellent task!
Here is my web page adult sex games
sir, how to obtain Developer API from the service provider. What is the procedure ?
ReplyDeletePlease help me.
Hi Arun,
ReplyDeleteGood Day.
Nice to see the content of the project.
Could you send the project to me.It will be helpful to me.
How much they charge to get developer API from the service provider. What is the procedure to get Developer API.
My Mail ID : rbala100@gmail.com
Thanks for your support.
Balamurugan R