Please guys i need help with this. I am conversant with VB but i don't understand how am going to interrellate the Mobile phone and the Server to enable them to communicate. Can someone explain to me what steps i should take i don't mind if i could see a piece of code so i can know if am on the right track.Thank you.:confused:

Dani AI

Generated

Short, practical summary and next steps (builds on original ask and the replies from , and ).

There are two reliable architectures for two‑way SMS with VB: (A) attach a GSM modem/compatible phone to the PC and speak AT commands to it, or (B) use a cloud SMS provider that forwards inbound texts to your server (webhook/email). The email-to-SMS trick mentioned by is useful for simple outbound messages but is unreliable for robust inbound handling; ActiveX/third‑party wrappers (as noted) can simplify things for VB6 but they still sit on top of the same modem or gateway choices below.

Local GSM modem approach (good for lab/low‑volume, no recurring provider cost)

  1. Get a USB GSM modem or a phone that exposes a serial/COM interface and a working SIM.
  2. Open the COM port from VB, set the modem to SMS text mode and enable new‑message notifications, then parse unsolicited responses like +CMTI or +CMT and pull the message with AT+CMGR / AT+CMGL. This is the standard AT command flow for reading SMS on a modem. (diafaan.com)

Minimal VB.NET pattern (event‑driven)

' Example outline (VB.NET): open COM, enable text mode, watch DataReceived
Dim sp As New IO.Ports.SerialPort("COM3", 115200)
sp.NewLine = vbCrLf
AddHandler sp.DataReceived, AddressOf Port_DataReceived
sp.Open()
sp.WriteLine("AT+CMGF=1")   ' text mode
sp.WriteLine("AT+CNMI=2,1") ' enable new SMS notifications

Handle incoming text in the DataReceived handler, look for +CMTI: (index) or +CMT: (inline message) and then request the stored message with AT+CMGR=<index>. Use the .NET SerialPort/DataReceived pattern shown in Microsoft docs. (learn.microsoft.com)

Cloud SMS gateway approach (recommended for production)
Buy a virtual number from a provider and configure an inbound webhook (HTTP POST) so the provider delivers each incoming SMS to a URL on the server. This removes hardware, scales easily, and makes processing and logging straightforward (but incurs per‑message costs). Providers document inbound webhooks and example flows. (twilio.com)

Troubleshooting and cautions
Test the modem first with a terminal (PuTTY/HyperTerminal). Verify SIM is SMS‑enabled and not PIN‑locked, check the correct COM driver and baud, and be aware text mode (AT+CMGF=1) may not support concatenated/unicode messages — use PDU mode if you need full character support. Always consult the modem’s AT manual for exact CNMI/CPMS behavior. (txtonline.com)

Choose a local modem for quick prototyping or when no external provider is allowed; choose a gateway/webhook for scale, reliability and easier server integration.

Recommended Answers

All 7 Replies

I send sms but I always send it as email to the correctly formatted address for the mobile phone provider. I did a little project in VB6 to do exactly what you are asking about. It sends email through the users Outlook, a less than perfect solution.

You could use a dropdown/combo to allow the user to select a provider. Here's the code I'm using to handle the provider:

Select Case cboProvider
        Case "Cingular"
            strProvider = "@cingularme.com "
    
        Case "Verizon"
            strProvider = "@vtext.com"
    
        Case "AllTel", "AllTell"
            strProvider = "@message.AllTel.com"
    
        Case "T-Mobile", "TMobile"
            strProvider = "@tmomail.net"
    
        Case "Virgin Mobile", "VirginMobile"
            strProvider = "@vmobl.com"
    
        Case "Sprint"
            strProvider = "@messaging.sprintpcs.com"
    
        Case "Nextel"
            strProvider = "@messaging.nextel.com" 
    
        Case "Cellular South", "CellularSouth"
            strProvider = "@csouth1.com"
    End Select

Now you need to get the phone number and put it on the beginning of the string. Something like this:

strEmailAddress = strPhNumber & strProvider

Hi,

Thank you so much.I am definately going to give it a trial.At the moment i maneged to send an sms from VB to a mobile phone now am working on how to send an sms from the mobile to the PC.

Am doing my Engineering project where by a Tesco customer has to send an sms to the Tesco server and receive information on the location and price of a product in the supermarket.

Regards:)

Hi,

Thank you for your help i will definately try it. So far i have managed to send an sms using VB from the PC to the mobile now am working on how i can send an sms from the mobile to the PC. Any ideas are welcomed.

Regards.:)

Search for "Logiccode GSM SMS ActiveX Dll" in google and download the required file.

It is easy to use. Include the reference for this DLL. Create Instance of the objects. Pass on the port name to which your mobile/GSM Modem is connected along with your mobile number, sim card number..then send.

Demo is available in the pack. Try this.

If this works. Kindly acknowledge.

If you find any other answer. Kindly forward it to me

can u tell me how you have acheived to send SMS from VB Program (PC) to Mobile

Ya! please Share this codin method.
am newbie! nd waiting
plz e.mail me
<snip>

Hi,

Why don't you try Txtimpact.

They provide Activ X as wel as HTTP API.

Here is the site

http://www.txtimpact.com/

Try it............

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.