title: Sending SMS with AT command through C#
body: <p>I have written SMS application in C#. My question is:I want to send SMS to multiple users. But,it's sending to one user. What is wrong?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>public void openPort()
      {
          port.Close();
          port.PortName = "COM11";
          port.ReceivedBytesThreshold = 1;
          port.BaudRate = 115200;
          port.DtrEnable = true;
          port.Open();
       }
    public void sendSMS(string mmobil)
    {
         this.mobil = mmobil;
         port.WriteLine("AT\r");
          port.WriteLine("AT+CMGF=1\r");
          port.WriteLine("AT+CMGS=\"" + mmobil + "\"\r");
          port.WriteLine("TEST" + '\x001a');
    }
  
    static void Main(string[] args)
      {
  
  
   List &lt;string&gt;mymobil= new List&lt;string&gt;();
          mymobil.Add("+316207XXX");
          mymobil.Add("+316141XXX");
  
   foreach (string mobil in mymobil)
         {
  
             openPort();
             sendSMS(mobil);
         }
      } 
  </code></pre>