Hi

i heard that i can send sms from my pc using my cell phone . Then use the computer / PC and AT commands to instruct the mobile phone or GSM/GPRS modem to send SMS messages., does anyone know anything about this.

What is these AT commands and how do i setup the whole thing to work.

Thanks

Dani AI

Generated

Two practical patterns for sending SMS from a PC-backed web app are already mentioned in the thread: control a local GSM device (phone or USB modem) from the server, or call a third‑party SMS gateway. This note summarizes safe architecture choices and common pitfalls, and ties them back to points raised by , , and .

Best practice for ASP.NET environments is to separate web UI from hardware I/O. The web application should only enqueue messages (database or durable queue). A separate background process or Windows Service dequeues items and talks to the attached device (driver/COM port handling, modem initialization, delivery reporting, retries). That keeps request threads fast, avoids permission/hosting issues, and centralizes modem error recovery and logging. For hosted/shared servers, the gateway/API route is usually the practical choice; for in‑house solutions that must receive SMS or avoid per‑message provider fees, a dedicated GSM modem on-premises is more appropriate.

Example workflow (conceptual):

// web app: enqueue
using(var conn = new SqlConnection(connStr))
using(var cmd = new SqlCommand("INSERT INTO SmsQueue (ToNumber, Message) VALUES (@to,@msg)", conn))
{
    cmd.Parameters.AddWithValue("@to", to);
    cmd.Parameters.AddWithValue("@msg", text);
    conn.Open();
    cmd.ExecuteNonQuery();
}

// worker: simple loop (separate process/service)
while(true)
{
    var item = DequeueNext();
    if(item != null)
        SendViaDevice(item); // device-specific serial logic lives here
    Thread.Sleep(500);
}

Practical cautions: verify the device exposes a serial/COM interface and vendor drivers are installed; do not hold a port open from ASP.NET request threads; implement idempotency, retries, exponential backoff and thorough logging; watch encoding (GSM vs Unicode) and concatenation limits; expect lower throughput from consumer phones and prefer dedicated modems for production. Tie these recommendations to the earlier advice in the thread: test device connectivity first (as suggested), pick a gateway if hosting is constrained (as and noted), and use a queued worker model for any ASP.NET integration.

Recommended Answers

All 6 Replies

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.

HI

Can I do this with a c# code in an ASP.NET web application. I want the sms to be sent from my web application. Is it possible and if yes, can you please give me the code snipet for doing this.

Sending from the modem is not possible in ASP.net code.

But you can send SMS using ASP.net from a bulk sms gateway. Its very easy, a siple URL call.

Do i have to pay anything for using the bulk sms gateway. and how do I use it? Sorry to bother you so much but i really have to do this urgently.

Do i have to pay anything for using the bulk sms gateway. and how do I use it? Sorry to bother you so much but i really have to do this urgently.

Yes my dear, the idea is that you buy bulk smses and use your account in sending the smses. I personally use intellisoft's gateway(s). See a similar post i did just today.
http://www.daniweb.com/techtalkforums/post377646.html#post377646
Further questions? get back to me.:cool:

Let me try and answer your questions.

Do you need to receive SMS? If you need to receive SMS, you will need to host your own GSM device or modem so that people can send you SMS.

If not, you can just use internet SMS gateways like clickatell to do the work, and post to them by HTTP, XML or email. The cost is about 6-8 cents per SMS. There are cheaper services, but not always reliable. If you need to host your own GSM device, you can use software like http://www.kannel.org (GPL Open Source) or <snipped>.

Regards,
<snipped>

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.