|
-
June 7th, 2004, 06:48 AM
#1
Send SMS to mobile
Dear All,
How to send SMS from VB .Net to mobile device.
I had some sample code but, it refers sms.dll win32 api where can i found this file.
Thanks
K.Babu
Please avoid sending emails to my personal mail:
write your doubts as thread in Codeguru
Crystal Reports Forum.
This will help all people having similar matters, and will let people who know solutions on the specific topic
share their knowledge.
Visit my company web site (Qmax Test Equipments Private Limited)
Yours friendly,
K.Babu
-
June 7th, 2004, 11:32 AM
#2
Code:
' You need the freeware ASMSCTRL.DLL to run the sample.
' Download it from http://www.vahland.com/pub/asmsctrl.dll
' and register it on your machine.
' Then, choose 'Add Reference' from your Solutions Window,
' and add the ActiveSocket Type Library.
'
' Read http://www.vahland.com/pub/asmsctrl.htm for more info.
Imports ASMSCTRLLib
Module Module1
Sub Main()
Dim objSmsTool As ASMSCTRLLib.SMSC
Dim strReceived As String
Dim nCounter As Integer
Console.WriteLine("Be sure To have the freeware asmsctrl.dll registered on your system,")
Console.WriteLine("and add the 'ActiveXperts SMS and Pager Toolkit' to your references.")
Console.WriteLine("")
Console.WriteLine("This sample connects through a SMSC service provider to send out the SMS message")
Console.WriteLine("Please check out www.activexperts.com/activsms/smsclist for a complete list of SMSC providers world wide")
Console.WriteLine("")
objSmsTool = New ASMSCTRLLib.SMSCClass()
objSmsTool.PortID = 3
objSmsTool.MessageText = "Hello, this is a test message"
objSmsTool.Recipient = "0624896641"
objSmsTool.ProviderDialString = "0,0653141414" ' The SMSC provider
Console.WriteLine("Sending message...")
objSmsTool.SendMessage(True)' TRUE means: through service provider
If objSmsTool.LastError = 0 Then
' YES, connection established.
Console.WriteLine("Message successfully delivered")
Else
Console.WriteLine("Message delivery failed, error: " + objSmsTool.LastError)
End If
End Sub
End Module
//**************************************
//
// Name: SMS message sample code
// Description:Send an SMS message throu
// gh SMSC service provider. There are hund
// reds of SMSC service providers all over
// the world
// By: Rowen VanderLaan
//**************************************
Good Luck,
Craig - CRG IT Solutions - Microsoft Gold Partner
-My posts after 08/2015 = .NET 4.x and Visual Studio 2015
-My posts after 11/2011 = .NET 4.x and Visual Studio 2012
-My posts after 02/2010 = .NET 4.0 and Visual Studio 2010
-My posts after 12/2007 = .NET 3.5 and Visual Studio 2008
-My posts after 04/2007 = .NET 3.0 and Visual Studio 2005
-My posts before 04/2007 = .NET 1.1/2.0
*I do not follow all threads, so if you have a secondary question, message me.
-
June 8th, 2004, 05:46 AM
#3
Send SMS to Mobile
1. PortID property not available in asmsctrl class.
2. Available Device property to set the device name. like "COM 1","COM 2".
But we are not using modem, we using router with ISDN line throught LAN connection, assigned with Gateway address.
so, what should i enter the device property.
Thanks,
K.Babu
Originally posted by Craig Gemmill
Code:
' You need the freeware ASMSCTRL.DLL to run the sample.
' Download it from http://www.vahland.com/pub/asmsctrl.dll
' and register it on your machine.
' Then, choose 'Add Reference' from your Solutions Window,
' and add the ActiveSocket Type Library.
'
' Read http://www.vahland.com/pub/asmsctrl.htm for more info.
Imports ASMSCTRLLib
Module Module1
Sub Main()
Dim objSmsTool As ASMSCTRLLib.SMSC
Dim strReceived As String
Dim nCounter As Integer
Console.WriteLine("Be sure To have the freeware asmsctrl.dll registered on your system,")
Console.WriteLine("and add the 'ActiveXperts SMS and Pager Toolkit' to your references.")
Console.WriteLine("")
Console.WriteLine("This sample connects through a SMSC service provider to send out the SMS message")
Console.WriteLine("Please check out www.activexperts.com/activsms/smsclist for a complete list of SMSC providers world wide")
Console.WriteLine("")
objSmsTool = New ASMSCTRLLib.SMSCClass()
objSmsTool.PortID = 3
objSmsTool.MessageText = "Hello, this is a test message"
objSmsTool.Recipient = "0624896641"
objSmsTool.ProviderDialString = "0,0653141414" ' The SMSC provider
Console.WriteLine("Sending message...")
objSmsTool.SendMessage(True)' TRUE means: through service provider
If objSmsTool.LastError = 0 Then
' YES, connection established.
Console.WriteLine("Message successfully delivered")
Else
Console.WriteLine("Message delivery failed, error: " + objSmsTool.LastError)
End If
End Sub
End Module
Please avoid sending emails to my personal mail:
write your doubts as thread in Codeguru
Crystal Reports Forum.
This will help all people having similar matters, and will let people who know solutions on the specific topic
share their knowledge.
Visit my company web site (Qmax Test Equipments Private Limited)
Yours friendly,
K.Babu
-
June 8th, 2004, 04:02 PM
#4
according to the site that dll comes from , you need a modem to use it. here's a quote from the product overview page ...
You just need a standard Hayes compatible modem (no GSM) to send SMS/Pager messages through a provider.
string Signature = Censored; 
-
June 11th, 2004, 08:31 AM
#5
You can also use a mobile phone connected to your PC through blue tooth or a serial cable or even infra red I guess. I have successfully used blue tooth.
Jesus died for my sin and now I am free
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|