User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 456,593 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,534 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our VB.NET advertiser: Programming Forums
Views: 71725 | Replies: 30
Reply
Join Date: Oct 2006
Posts: 1
Reputation: CajunTechie is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
CajunTechie CajunTechie is offline Offline
Newbie Poster

Re: sending sms using vb.net

  #21  
Oct 12th, 2006
Originally Posted by ruisi View Post
hi, im new to vb.net and recently i am doing a web application on sending sms. anyone has got any codes for sending sms using vb.net?

or does anyone know where i can get relevant info for it.


I'm currently in the process of developing an VB.NET application that uses SMS. The absolute easiest way of doing this is to use an SMS gateway service such as ClickaTell to handle the actual bidirectional delivery. Using a gateway will allow you to deliver and recieve messages to/from many mobile networks and will greatly simplify your application development.

Hope this helps...

Anthony Papillion
Mobile Text Solutions
www.mobiletextsolutions.com
Reply With Quote  
Join Date: May 2007
Posts: 18
Reputation: thin_master is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
thin_master thin_master is offline Offline
Newbie Poster

Re: sending sms using vb.net

  #22  
May 29th, 2007
Yes you can send SMS from many mobile phones using your PC. But not all mobiles support that. You will have to check by connecting the mobile to your PC using its data cable and trying the command AT on it using hyper terminal.

There are many AT commands.

To send SMS you can can use

AT+CMGS=<number>
<message>ctrl+z

To read sms from inbox you can use

AT+CMGR=<address>
address is the location number, can be 1, 2... etc.

There are commands for almost everything you can do with the phone.

Before attempting this make sure that you are skillled in serial port programming.
Reply With Quote  
Join Date: Jul 2007
Posts: 4
Reputation: rodrod is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
rodrod rodrod is offline Offline
Newbie Poster

Re: sending sms using vb.net

  #23  
Jul 18th, 2007
Hello guyz...i need your advices for which method to use for sending SMS using .NET.
DO I USE THE SMPP (to access to the sever)?
or I USE THE WEB SERVICE PROVIDERS???
Thanks...
and for all the folks who want a piece of code...
Here's what ive done so far (i also need your feedbacks):
private void Send_Click(object sender, System.EventArgs e)
{
   try
      {
   	SmsTest.com.webservicex.www.SendSMSWorld smsWorld =  
         new SmsTest.com.webservicex.www.SendSMSWorld();
            smsWorld.sendSMS(txtEmailId.Text.Trim(), 
                    txtCountryCode.Text.Trim(), 
                    txtMobileNo.Text.Trim(), txtMessage.Text);
        lblMessage.Visible = true;
        lblMessage.Text="Message Send Succesfully";
      }
   
    catch(Exception ex)
    {
        lblMessage.Visible = true;
        lblMessage.Text="Error in Sending message"+ex.ToString();
    }
}
THANKS. assaf.rawad@gmail.com
Reply With Quote  
Join Date: Jun 2007
Posts: 8
Reputation: qasauria is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
qasauria qasauria is offline Offline
Newbie Poster

Re: sending sms using vb.net

  #24  
Jul 18th, 2007
I'm using VB6.O for such an application.all u need is to know modem (phone) AT commands ,API's and a connection to your comp using either IrDA (infrared ) or a RS232 cable for the same.
Reply With Quote  
Join Date: Sep 2007
Posts: 1
Reputation: techie_kerala is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
techie_kerala techie_kerala is offline Offline
Newbie Poster

Re: sending sms using vb.net

  #25  
Sep 3rd, 2007
hi there
for sending sms to mobiles first of all you must select a protocol like SMTP/SMPP/HTTP. and for more details log on to www.planetsourcecode.com
yor techie
Reply With Quote  
Join Date: Sep 2007
Posts: 1
Reputation: ajektus is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
ajektus ajektus is offline Offline
Newbie Poster

Re: sending sms using vb.net

  #26  
Sep 24th, 2007
Hi,

Im from philippines and i have a fargo maestro 100.
I want to maximize its usage but i dont actually how.
can you teach me?

Anyways thanks for posting, this really a big help.

Thanks.

ajektus
Philippines

Originally Posted by Jeanred View Post
HI,
Here is code for a dll file for VB.NET 2005 that I am currently using to send SMS Messages. Receiving SMS Messages are not done yet, but I will post it when it is done. This Code will work with FARGO Maestro 100 GSM Modem (WAVECOM)

Please note that this code use threading ...
 
 
Option Explicit On
Imports System
Imports System.Threading
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.IO.Ports
 
 
 
PublicClass SMSCOMMS
Private WithEvents SMSPort As SerialPort
Private SMSThread As Thread
Private ReadThread As Thread
Shared _Continue As Boolean = False
Shared _ContSMS As Boolean = False
Private _Wait As Boolean = False
Shared _ReadPort As Boolean = False
Private WithEvents DBServer As Postgres
Public Event Sending(ByVal Done As Boolean)
Public Event DataReceived(ByVal Message As String)
 
Public Sub New(ByRef COMMPORT As String)
SMSPort = New SerialPort
With SMSPort
.PortName = COMMPORT
.BaudRate = 9600
.Parity = Parity.None
.DataBits = 8
.StopBits = StopBits.One
.Handshake = Handshake.RequestToSend
.DtrEnable = True
.RtsEnable = True
.NewLine = vbCrLf
End With
DBServer = New Postgres()
ReadThread = New Thread(AddressOf ReadPort)
End Sub
 
Public Function SendSMS(ByVal CellNumber As String, ByVal SMSMessage As String) As Boolean
Dim MyMessage As String = Nothing
'
'Check if Message Length <= 160
If SMSMessage.Length <= 160 Then
MyMessage = SMSMessage
Else
MyMessage = Mid(SMSMessage, 1, 160)
End If
'MsgBox("Sending " & MyMessage & " to " & CellNumber)
If IsOpen = True Then
SMSPort.WriteLine("AT+CMGS=" & CellNumber & vbCr)
_ContSMS = False
While _ContSMS = False
Application.DoEvents()
End While
SMSPort.WriteLine(MyMessage & vbCrLf & Chr(26))
_Continue = False
RaiseEvent Sending(False)
End If
End Function
 
 
Private Sub ReadPort()
Dim SerialIn As String = Nothing
Dim RXBuffer(SMSPort.ReadBufferSize) As Byte
Dim SMSMessage As String = Nothing
Dim Strpos As Integer = 0
Dim TmpStr As String = Nothing
While SMSPort.IsOpen = True
If (SMSPort.BytesToRead <> 0) And (SMSPort.IsOpen = True) Then
While SMSPort.BytesToRead <> 0
SMSPort.Read(RXBuffer, 0, SMSPort.ReadBufferSize) 'SMSPort.BytesToRead
SerialIn = SerialIn & System.Text.Encoding.ASCII.GetString(RXBuffer)
' Handle Internal Events
' For Received Characters
If SerialIn.Contains(">") = True Then
_ContSMS = True
End If
If SerialIn.Contains("+CMGS:") = True Then
_Continue = True
RaiseEvent Sending(True)
_Wait = False
SerialIn = String.Empty
ReDim RXBuffer(SMSPort.ReadBufferSize)
End If
 
End While
RaiseEvent DataReceived(SerialIn)
SerialIn = String.Empty
ReDim RXBuffer(SMSPort.ReadBufferSize)
End If
End While
End Sub
 
 
Public ReadOnly Property IsOpen() As Boolean
Get
If SMSPort.IsOpen = True Then
IsOpen = True
Else
IsOpen = False
End If
End Get
End Property
 
Public Sub Open()
If IsOpen = False Then
SMSPort.Open()
ReadThread.Start()
End If
End Sub
 
Public Sub Close()
If IsOpen = True Then
SMSPort.Close()
End If
End Sub
 
 
 
 
EndClass
 

Usage Of The Above Code Should be straight Forward, But Here Goes

In a Windows Form App

Option Explicit On
 
'Other Imports
Imports SMSCOMMS
' Rest of stuff
 
'Declarations
Public WitheEvents SMSEngine as SMSCOMMS
 
Public Sub Main()
   SMSEngine = New SMSCOMMS("COM1")
    SMSEngine.Open()
    SMSEngine.SendSMS("000000000","THIS IS YOUR MESSAGE")
End Sub
 
Public Sub Form_Close()
 SMSEngine.Close()
End Sub
 

I Hope this helps
Reply With Quote  
Join Date: Jan 2008
Posts: 1
Reputation: jignesh_1508 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
jignesh_1508 jignesh_1508 is offline Offline
Newbie Poster

Re: sending sms using vb.net

  #27  
Jan 31st, 2008
hi, i Saw ur Code to Send Message Using AT Command .Can u Pls Help me?
i m Working on Vb.net.
i want to Store Message in Variable When Any New Message Arrive On Hyperterminal.
and
How Can i Run Multiple AT commands together in vb.net?

pls friend help me.
if u Have and Code in vb.net to Recieve Message from port then Pls send me .........
thanx in Advance


Originally Posted by Jeanred View Post
HI,
Here is code for a dll file for VB.NET 2005 that I am currently using to send SMS Messages. Receiving SMS Messages are not done yet, but I will post it when it is done. This Code will work with FARGO Maestro 100 GSM Modem (WAVECOM)

Please note that this code use threading ...
 
 
Option Explicit On
Imports System
Imports System.Threading
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.IO.Ports
 
 
 
PublicClass SMSCOMMS
Private WithEvents SMSPort As SerialPort
Private SMSThread As Thread
Private ReadThread As Thread
Shared _Continue As Boolean = False
Shared _ContSMS As Boolean = False
Private _Wait As Boolean = False
Shared _ReadPort As Boolean = False
Private WithEvents DBServer As Postgres
Public Event Sending(ByVal Done As Boolean)
Public Event DataReceived(ByVal Message As String)
 
Public Sub New(ByRef COMMPORT As String)
SMSPort = New SerialPort
With SMSPort
.PortName = COMMPORT
.BaudRate = 9600
.Parity = Parity.None
.DataBits = 8
.StopBits = StopBits.One
.Handshake = Handshake.RequestToSend
.DtrEnable = True
.RtsEnable = True
.NewLine = vbCrLf
End With
DBServer = New Postgres()
ReadThread = New Thread(AddressOf ReadPort)
End Sub
 
Public Function SendSMS(ByVal CellNumber As String, ByVal SMSMessage As String) As Boolean
Dim MyMessage As String = Nothing
'
'Check if Message Length <= 160
If SMSMessage.Length <= 160 Then
MyMessage = SMSMessage
Else
MyMessage = Mid(SMSMessage, 1, 160)
End If
'MsgBox("Sending " & MyMessage & " to " & CellNumber)
If IsOpen = True Then
SMSPort.WriteLine("AT+CMGS=" & CellNumber & vbCr)
_ContSMS = False
While _ContSMS = False
Application.DoEvents()
End While
SMSPort.WriteLine(MyMessage & vbCrLf & Chr(26))
_Continue = False
RaiseEvent Sending(False)
End If
End Function
 
 
Private Sub ReadPort()
Dim SerialIn As String = Nothing
Dim RXBuffer(SMSPort.ReadBufferSize) As Byte
Dim SMSMessage As String = Nothing
Dim Strpos As Integer = 0
Dim TmpStr As String = Nothing
While SMSPort.IsOpen = True
If (SMSPort.BytesToRead <> 0) And (SMSPort.IsOpen = True) Then
While SMSPort.BytesToRead <> 0
SMSPort.Read(RXBuffer, 0, SMSPort.ReadBufferSize) 'SMSPort.BytesToRead
SerialIn = SerialIn & System.Text.Encoding.ASCII.GetString(RXBuffer)
' Handle Internal Events
' For Received Characters
If SerialIn.Contains(">") = True Then
_ContSMS = True
End If
If SerialIn.Contains("+CMGS:") = True Then
_Continue = True
RaiseEvent Sending(True)
_Wait = False
SerialIn = String.Empty
ReDim RXBuffer(SMSPort.ReadBufferSize)
End If
 
End While
RaiseEvent DataReceived(SerialIn)
SerialIn = String.Empty
ReDim RXBuffer(SMSPort.ReadBufferSize)
End If
End While
End Sub
 
 
Public ReadOnly Property IsOpen() As Boolean
Get
If SMSPort.IsOpen = True Then
IsOpen = True
Else
IsOpen = False
End If
End Get
End Property
 
Public Sub Open()
If IsOpen = False Then
SMSPort.Open()
ReadThread.Start()
End If
End Sub
 
Public Sub Close()
If IsOpen = True Then
SMSPort.Close()
End If
End Sub
 
 
 
 
EndClass
 

Usage Of The Above Code Should be straight Forward, But Here Goes

In a Windows Form App

Option Explicit On
 
'Other Imports
Imports SMSCOMMS
' Rest of stuff
 
'Declarations
Public WitheEvents SMSEngine as SMSCOMMS
 
Public Sub Main()
   SMSEngine = New SMSCOMMS("COM1")
    SMSEngine.Open()
    SMSEngine.SendSMS("000000000","THIS IS YOUR MESSAGE")
End Sub
 
Public Sub Form_Close()
 SMSEngine.Close()
End Sub
 

I Hope this helps
Reply With Quote  
Join Date: Apr 2008
Posts: 1
Reputation: singamasae is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
singamasae singamasae is offline Offline
Newbie Poster

Re: sending sms using vb.net

  #28  
Apr 4th, 2008
i need the code...
please send to my email : yande_jet@yahoo.com

thx.
Reply With Quote  
Join Date: Mar 2007
Posts: 2
Reputation: dananos is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
dananos dananos is offline Offline
Newbie Poster

Re: sending sms using vb.net

  #29  
Apr 7th, 2008
Hi,

There is some sample code for sending an SMS via VB.NET, if you go to www.freebiesms.co.uk, click "Custom Development", then "developers", it shows you how

Dan.
Reply With Quote  
Join Date: Jul 2007
Posts: 1
Reputation: vaidehi_p99 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
vaidehi_p99 vaidehi_p99 is offline Offline
Newbie Poster

Re: sending sms using vb.net

  #30  
Jun 15th, 2008
sending sms using vb.net can be done by using Nokia dll file or sony erricson dll file. al hand set companies provide this dll file which can b included in the .net project.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb VB.NET Marketplace
Currently Active Users Viewing This Thread: 2 (1 members and 1 guests)

upstream

Thread Tools Display Modes

Similar Threads
Other Threads in the VB.NET Forum

All times are GMT -4. The time now is 6:45 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC