Dim SMSEngine As New SMSCOMMS("COM4") 'the port needs to be initialised SMSPort = New SerialPort With SMSPort .PortName = COMMPORT .BaudRate = 19200 .Parity = Parity.None .DataBits = 8 .StopBits = StopBits.One .Handshake = Handshake.RequestToSend .DtrEnable = True .RtsEnable = True .NewLine = vbCrLf End With 'this is the set of AT commands to be written on serial port SMSPort.WriteLine("AT") 'set command message format to text mode(1) SMSPort.WriteLine("AT+CMGF=1" & vbCrLf) 'set service center address (which varies for service providers (idea, airtel)) SMSPort.WriteLine("AT+CSCA=""+919822078000""" & vbCrLf) ' enter the mobile number whom you want to send the SMS SMSPort.WriteLine("AT+CMGS= + TextBox1.text + " & vbCrLf) _ContSMS = False SMSPort.WriteLine("+ TextBox1.text +" & vbCrLf & Chr(26)) 'SMS sending Dim i As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click SMSEngine.Open() 'open the port SMSEngine.SendSMS() 'send the SMS End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)