At last I got time to write one of important topic 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.
Download SMS Demo project Setup without code 2.67mb
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.
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
Public Sub 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)
'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
Now after learning it you can explore it in details to get more powerful options for your programs.
Best of Luck for Programming.
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.
Ρrеtty nіce ρoѕt. I sіmрlу
ReplyDeleteѕtumbled upon your ωeblog аnd ωishеԁ to mentіon that
I've truly loved surfing around your blog posts. After all I'll be ѕubscribing foг
yоur fеed anԁ I hopе you ωritе agаin ѕoon!
Feel free to ѕurf to mу webрage; Author's external home page...
I was extremely pleased to uncover this page. I want to to
ReplyDeletethank you for your time for this particularly wonderful read!
! I definitely loved every part of it and i also
have you book marked to see new things on your website.
my blog - new york escorts
Yes! Finally someone writes about ab glider.
ReplyDeleteHello, i think that i saw you visited my site so i came to “return the favor”.I am trying to find things to enhance my web site!I suppose its ok to use some of your ideas!!
ReplyDeleteHere is my weblog :: pure garcinia cambogia extract
No matter if some one searches for his required thing, so he/she needs to be available that in detail,
ReplyDeletethus that thing is maintained over here.
Here is my website debt
Saved as a favorite, I love your blog!
ReplyDeleteFeel free to visit my weblog ... keratocone
Hi my friend! I want to say that this article is awesome, nice written and
ReplyDeleteinclude approximately all important infos. I would like to
peer more posts like this .
Feel free to surf to my page Whatsapp Hack
You are advised to print the log of this whole process
ReplyDeleteso that you can use it in future for the purpose of hard drive
repair and maintenance. But few simple things like those mentioned above will always
keep your system running at its highest speed.
But they rarely notice that with the reinstallation of the programs, the computer speed will also
become slower.
My site; Increase Computer Speed
Appreciating the hard work you put into your blog
ReplyDeleteand detailed information you present. It's nice to come across a
blog every once in a while that isn't the same out
of date rehashed information. Excellent read! I've saved your site and I'm
adding your RSS feeds to my Google account.
Feel free to surf to my blog :: bet angel
I used to be suggested this website by means of my cousin.
ReplyDeleteI'm no longer certain whether this submit is written by
him as nobody else recognise such precise about my problem.
You're amazing! Thank you!
My web-site Gama's Landscaping
There's aldo a hint that the PS3 version of the game will finally be fixed
ReplyDeleteto work with DLC. I am sure expelling soon our up-to-the-minute version of a new wind turbine
so , make sure to are another the first oness to pay money for this prticular tv show.
Well in that location are a only a few places where sole
can get a majority of these and additional.
my web page Psn code generator uk
This design is spectacular! You most certainly know how to keep a reader entertained.
ReplyDeleteBetween your wit and your videos, I was almost moved to start my own blog (well, almost...HaHa!) Wonderful
job. I really loved what you had to say, and more than that, how you presented it.
Too cool!
Here is my web blog porn
This design is spectacular! You most certainly know how to keep a reader
ReplyDeleteentertained. Between your wit and your videos, I was almost moved to start my own blog (well, almost...HaHa!) Wonderful job.
I really loved what you had to say, and more than that,
how you presented it. Too cool!
My homepage ... porn
Hello there I am so thrilled I found your webpage, I really found
ReplyDeleteyou by accident, while I was browsing on Aol for something else, Regardless I am here now and would just like to say thank
you for a marvelous post and a all round exciting blog (I
also love the theme/design), I don�t have time to read it all at the minute but I have bookmarked it and also added
your RSS feeds, so when I have time I will be back to read more, Please do keep up the awesome
work.
Feel free to surf to my site; dating site
I want to to thank you for this excellent read!! I absolutely loved every
ReplyDeletelittle bit of it. I have got you bookmarked to look at new stuff you post…
Here is my homepage - Veronica
What's up, I would like to subscribe for this
ReplyDeletewebsite to get hottest updates, thus where can i do it please assist.
Take a look at my site Somerset Business
This comment has been removed by the author.
ReplyDeletethanks bro
ReplyDeleteGood and amazing post. Nice to read your post it's give such a good information. Waiting for next post. If you want to do marketing for your business just click
ReplyDeleteBulk Sms Service Provider in Bengal
This comment has been removed by the author.
ReplyDeleteHi sir. Can you send the code to me ? fairuzjahrom@gmail.com . TQ sir
ReplyDeleteNice I love your blog!
ReplyDeleteBulk SMS Hyderabad
Bulk SMS providers Hyderabad
Thanks for sharing the information with us. Keep share more and more.
ReplyDeleteThanks for sharing the information
ReplyDeletebulk messaging service india
MsgClub provides simple and secure bulk sms api integration.You can easily integrate our api into your software in few min
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteGood Article.
ReplyDeleteNation Remembers Atalji - Live Update and Trending Now
Thank you for all the useful information. We tend to consider modifying this article with new information. it is often terribly an exquisite item. I appreciate your efforts. Keep posting new updates with us.
ReplyDeleteDedicatedHosting4u.com
Very Nice article ! great job. Thanks for sharing.
ReplyDeletePromote your business brands with bulk SMS marketing, contact us at +917404900081
Bulk SMS
Bulk SMS Service
Bulk SMS Marketing