Click here to Skip to main content
15,881,768 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I am developing an app. is there any way to send SMS to other mobile by pushing command to the connected mobile to pc to send SMS. I am working on windows form any help will be appreciated.

refer this image http://imageshack.com/a/img199/9882/jeof.jpg[^]
Posted
Updated 20-Feb-14 21:50pm
v7
Comments
ridoy 14-Nov-13 12:33pm    
Not a well constructed question though.

Google is your friend: Be nice and visit him often. He can answer questions a lot more quickly than posting them here...

A very quick search gave over 100,000 hits: Send SMS via mobile c#[^]

In future, please try to do at least basic research yourself, and not waste your time or ours.
 
Share this answer
 
Comments
agent_kruger 25-Nov-13 5:16am    
OriginalGriff thanks for sg=howing interest in this topic. But i have researched a lot and i dont need to send message over GSM modem but i need my app to give message to my mobile (viz. connected to my pc) to send a message to another mobile
Use This Code I have Used Dongle To Send Sms Its Working

C#
using System;
using System.Collections.Generic;
using System.Threading;
using System.IO.Ports;
using System.Windows.Forms;
using System.Management;
using System.Management.Instrumentation;

namespace gi
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        SerialPort s;
        private void button1_Click(object sender, EventArgs e)
        {

            string comport = cboPorts.Text;
            GetPort(comport);
        }
        public void GetPort(string comport)
        {
           // if (this.s == null)
            {
                this.s = new SerialPort();
                this.s.PortName = comport;
                this.s.Open();
                this.s.BaudRate = 9600;
                this.s.Parity = Parity.None;
                this.s.DataBits = 8;
                this.s.StopBits = StopBits.One;
                //this.s.Handshake = Handshake.RequestToSend;
                this.s.DtrEnable = true;
                this.s.RtsEnable = true;
                //this.s.RtsEnable = true;
                this.s.NewLine = System.Environment.NewLine;
                this.s.WriteLine("AT" + (char)(13));
                //string tt = s.ReadLine();
               // if(s.ReadLine()!="AT/r/r")
                {
                    Thread.Sleep(2000);
                    this.s.WriteLine("AT+CMGF=1" + (char)(13));
                    Thread.Sleep(3000);
                    this.s.WriteLine("AT+CMGS=\"" + 8050398620 + "\"");
                    Thread.Sleep(5000);
                    this.s.WriteLine(">" + "le" + (char)(26));
                    this.s.Close();
                }
                else
                {
                    MessageBox.Show("Dervice Nt");
                }
            }
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            string[] ports = SerialPort.GetPortNames();


            foreach (string port in ports)
            {
                cboPorts.Items.Add(port);
            }
        }
    }
}
 
Share this answer
 
Comments
agent_kruger 25-Nov-13 5:14am    
do not post code for GSM dongle i have one i need to give message to my mobile (viz. connected to my pc) to send a message to another mobile
murkalkiran 25-Nov-13 13:55pm    
ya i got it like what Cartier you want to send sms? eg: on particular time
Member 12227115 6-Mar-17 13:58pm    
murkalkiran can you give me complete code?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900