I want to send the message from my PC to my mobile usnig vb.net......
please help me.... it's urgent......
and if possible please provide the code....
thank you for your help in advance.... :)

Dani AI

Generated

For (post #3) the aim is to send an SMS from a PC using VB.NET; correctly asked whether “message” meant a text. Two practical approaches are common and reliable: (1) treat a GSM modem or a phone that exposes a modem interface and send AT commands over a serial port (offline, no per‑message gateway fees), or (2) call an HTTP/REST SMS gateway from VB.NET (requires signup and per‑message billing but is simple and scalable). Short VB.NET examples and key troubleshooting notes follow.

' GSM modem example (replace COM port and number)
Imports System.IO.Ports
Imports System.Threading

Sub SendSmsViaGsm()
    Dim port As New SerialPort("COM3", 115200, Parity.None, 8, StopBits.One)
    port.DtrEnable = True
    port.RtsEnable = True
    port.Open()

    port.Write("AT" & vbCr)
    Thread.Sleep(300)
    port.Write("AT+CMGF=1" & vbCr)          ' set text mode
    Thread.Sleep(300)
    port.Write("AT+CMGS=""+1234567890""" & vbCr)
    Thread.Sleep(300)
    port.Write("Hello from PC" & Chr(26))  ' Ctrl+Z to send
    Thread.Sleep(2000)

    port.Close()
End Sub
' HTTP API example using WebClient (replace endpoint and fields per provider)
Imports System.Net
Imports System.Text
Imports System.Collections.Specialized

Function SendSmsViaApi() As String
    Using client As New WebClient()
        Dim data As New NameValueCollection()
        data("to") = "+1234567890"
        data("message") = "Hello from PC"
        data("api_key") = "YOUR_API_KEY"

        Dim responseBytes = client.UploadValues("https://api.smsgateway.example/send", "POST", data)
        Return Encoding.UTF8.GetString(responseBytes)
    End Using
End Function

Troubleshooting and cautions: confirm correct COM port and baud rate; some phones do not expose AT interfaces over USB (vendor drivers or a dedicated GSM USB dongle are usually required). Always use international number format (+countrycode). SMS encoding matters (GSM 7‑bit vs UCS‑2 for Unicode); long messages may be split into concatenated parts. HTTP gateways require HTTPS, an API key, and will return status codes/errors — check provider docs for delivery receipts. Carrier charges and anti‑spam/legal rules apply. For a low‑volume, offline solution a GSM modem is suitable; for reliability/scalability an SMS gateway is usually the faster route.

Recommended Answers

All 2 Replies

What do you mean by the message? like as in a text?

ya ....
I want to send a text from PC to my mobile using my application.....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.