C# Tutorial - How to Send SMS Message C#.NET Winforms | FoxLearn

Sdílet
Vložit
  • čas přidán 14. 06. 2016
  • How to Send SMS Message via GSM Modem, 3G Modem, using AT Commands in C# Winforms. The C# Basics beginner course is a free C# Tutorial Series that helps beginning programmers learn the basics of the C# Programming Language
    Website: foxlearn.com
    C# Programming: Sending SMS using AT Commands
    Send Offline SMS Using C# Desktop Application
    How to send sms in c#.net
    C# Application - How to Send SMS using GSM offline
    How to Send sms in C# .Net (c# sms example)
    [C#] - SerialPort Connection - Send/Receive through COM Ports

Komentáře • 226

  • @RishabhJain-dz7jt
    @RishabhJain-dz7jt Před 6 lety

    Its very good as it is working properly. You make my day.
    Thanks :)

  • @hanescaballero5115
    @hanescaballero5115 Před 3 lety

    Thanks for sharing the tutorial it`s worked for me... KEEP IT UP!

    • @foxlearn
      @foxlearn  Před 3 lety

      You're welcome! Thank you !

  • @user-ly7yc6pr8f
    @user-ly7yc6pr8f Před 4 lety

    Hello, how should I put the program if what I want is for the message to be sent alone without having to send it?

  • @muhammadnaveed5056
    @muhammadnaveed5056 Před 6 lety

    i have SIM900a does it worked on it

  • @AbrarAhmad-mz8vl
    @AbrarAhmad-mz8vl Před 7 lety

    Hi Folk
    In my case message sent but not deliver on the phone number. How to handle Problem ?
    Im using Samsung Grand Prime Plus as GSM Modem.

  • @manjeetnandal1
    @manjeetnandal1 Před 4 lety

    Great thanks!

  • @umarfarooqkhan6736
    @umarfarooqkhan6736 Před 4 lety +1

    Hi sir is this code works on mobile instead of gsm modem

  • @samehsayed2196
    @samehsayed2196 Před 3 lety

    You are amazing bro

  • @creaturesolutions7670
    @creaturesolutions7670 Před 4 lety

    hi, i write the code same as you but i have not receive a single message.
    and m also not able to send message from textlocal site.
    and in site reports sections my all sent messages status is unknown.

  • @samerhameed7658
    @samerhameed7658 Před 7 lety +1

    Hello, thanks a lot it works successfully, but I have a question, how can I send an Arabic message? my GSM modem supports three type of encoding (IRA,GSM and UCS2). Note I modified the code to be UCS2 but in this case the message transferred from computer to modem but it did not sent from modem to the destination. Thanks for your help and support in advance

  • @bittukumar5653
    @bittukumar5653 Před 8 lety

    how can we implement these things in c# asp.net web application project..............please suggest me,
    Thank's in advance

  • @alleria48
    @alleria48 Před 6 lety

    Hi. Are you using the usb TTL to connect the GSM modem to pc? thank you

    • @adolphin6041
      @adolphin6041 Před 3 měsíci

      May be he's using something kinda, but using TTL module with arduino and connecting arduino's usb to the computer you can use it

  • @haydensoo8265
    @haydensoo8265 Před 7 lety

    can i apply it on a 2013 visual studio c# web forms ?

  • @marcusshamase2050
    @marcusshamase2050 Před 7 lety

    i don't have the gsm modem port in my laptop. where do i find it because i tried to install the GSMCOMM

    • @foxlearn
      @foxlearn  Před 7 lety

      Hi, You can get gsm port when installing GSM modem to your computer. Thank you

  • @MHDHassan2023
    @MHDHassan2023 Před 2 lety

    Can you make a video about using UCS2 C# Windows Forms

  • @AaAaa-oo9so
    @AaAaa-oo9so Před 6 lety

    I follow your tutorial but a message will appear that "The semaphore timeout period has expired"!

  • @sherwinmanguilin1173
    @sherwinmanguilin1173 Před 7 lety +1

    hi, can you create a video tutorial for automatic reading in serial port ?? with sms sender thanks

    • @foxlearn
      @foxlearn  Před 7 lety

      OK. Thank you for your suggestion

  • @insafide300
    @insafide300 Před 7 lety

    Thank you a lot it works so good
    I want to know how to send the same sms to a lot of phone numbers

    • @foxlearn
      @foxlearn  Před 7 lety +2

      Hi, You can save the phone number into .txt file, then read the file and call send method for each phone number, thanks

    • @sagarutwani4739
      @sagarutwani4739 Před 3 lety

      @@foxlearn and how much thread.sleep(seconds) we should give for not to block the sim

  • @brightscript
    @brightscript Před 3 lety

    why I can not send anther language text message like Persian with this app?

  • @manuelmartised1991
    @manuelmartised1991 Před 7 lety

    is necesary connect the módem to serial port ?

    • @foxlearn
      @foxlearn  Před 7 lety

      Yes, You need to get a GSM modem to play demo. You can connect to GSM modem via serial port. thanks

  • @iSoftInt
    @iSoftInt Před 4 lety +1

    First of all thanks for your help. I appreciate you works
    I'm done the works on your instruction
    and It's works properly.
    but when my message text length more than 159, It will showing some error message Looks Like "+CMS ERROR: 305"
    Could you help me please?

    • @foxlearn
      @foxlearn  Před 4 lety

      I think it's limit message text

    • @iSoftInt
      @iSoftInt Před 4 lety

      @@foxlearn I know that, any solution ?

  • @khaleed7991
    @khaleed7991 Před 4 lety

    How to send into many numbers?

  • @mianwahab5171
    @mianwahab5171 Před 4 lety +1

    Hy, I followed your every step, then when I sent the message, It displayed the message sent dialog box. But i never recieved the message. Why is that?

    • @foxlearn
      @foxlearn  Před 4 lety

      I think you should add your area phone, or check your code again

  • @celine8784
    @celine8784 Před 4 lety

    What's the connection?

  • @bittukumar5653
    @bittukumar5653 Před 8 lety

    can u please send me link of video courses on window mobile app development.......its urgent
    please suggest.

    • @foxlearn
      @foxlearn  Před 8 lety

      Hi, I haven't got the link. You can search on youtube or google. thanks

  • @harubayumali720
    @harubayumali720 Před 7 lety

    can i use usb broadband modem in this program?? thanks a lot

  • @norivincentaposaga8537

    Hello. I followed your code tutorial but when I hit send, the message box that appeared is the one that the message sent is failed. The phone number has the area code as well. (+63 in my area). Do you have any ideas on this? Thanks.

    • @foxlearn
      @foxlearn  Před 3 lety +1

      I think the service doesn't support your area phone

    • @norivincentaposaga8537
      @norivincentaposaga8537 Před 3 lety

      @@foxlearn Its working now. Thank you. Do you have any tutorials for sending multiple messages / bulk sms sending? Thank you.

    • @jay-annoliveros5358
      @jay-annoliveros5358 Před 2 lety

      @@norivincentaposaga8537 hello, paano po sya nag work sayo?

  • @mhassaan7405
    @mhassaan7405 Před rokem

    my pc is not showing modem what should I do?

  • @ameersultan1754
    @ameersultan1754 Před 7 lety

    hy how can i get the phone call number of coming call on my C# window form application using GSM Dongle?

    • @foxlearn
      @foxlearn  Před 7 lety

      I think you can read sms from gsm

    • @ameersultan1754
      @ameersultan1754 Před 7 lety

      please you make this program i will be very thankful to you

  • @riskhanrizvi6653
    @riskhanrizvi6653 Před 4 lety

    When i am trying to open my modem port it says The process cannot access the port 'COM25' because it is being used by another process
    Please help me someone

    • @otherhalfme98
      @otherhalfme98 Před 3 lety

      Did you find a solution? I got the same msg😑

  • @gamedev3dginger821
    @gamedev3dginger821 Před 4 lety

    Can someone help me? When i press send then i get the send failed message box.

    • @foxlearn
      @foxlearn  Před 4 lety

      Plug in your gms modem with sim card, then play demo

  • @bittukumar5653
    @bittukumar5653 Před 8 lety

    how to use recieved mobile message as a first time login credential in login page of asp.net..

  • @meetalijutt7021
    @meetalijutt7021 Před 5 lety

    please tell me code to sending sms with gsm to multiple numbers

    • @foxlearn
      @foxlearn  Před 5 lety

      Thank you for your suggestion !

  • @ztieusai
    @ztieusai Před 4 lety

    Hey bro! I really like your code but when I run it. Message show Failed! Can u help me please!

    • @foxlearn
      @foxlearn  Před 4 lety +1

      What error are you getting?

    • @ztieusai
      @ztieusai Před 4 lety

      @@foxlearn I did it, But I want send many messages in one sms. It mean the message sequential not split mutil part. Thanks for reading!

  • @kaizartariq9531
    @kaizartariq9531 Před 5 lety

    serialPort.WriteLine(string.Format("AT+CMGS=\"{0}\"{1}",PhoneNumber, Environment.NewLine));
    Please use this..

  • @peterjayimboy7769
    @peterjayimboy7769 Před 5 lety

    what gms module are you using?

    • @foxlearn
      @foxlearn  Před 5 lety

      gms modem

    • @peterjayimboy7769
      @peterjayimboy7769 Před 5 lety

      @@foxlearn mine is returning error .. something like port is being used by another process .. how can i fix this?

    • @foxlearn
      @foxlearn  Před 5 lety

      Have you got GMS modem? please plugin your device

  • @musaqadry3358
    @musaqadry3358 Před 6 lety

    for me it is not work at all

  • @danielkrudolf
    @danielkrudolf Před 4 lety

    Works on D-Link DWM-157 - 3G HSDPA USB adapter

    • @zeeshanahmad1240
      @zeeshanahmad1240 Před 3 lety

      Are you sure. Because i want use it for sms alerts in c sharp software

    • @danielkrudolf
      @danielkrudolf Před 3 lety

      @@zeeshanahmad1240 100 % sure, because I use it exactly for sms alerting. I recommend you only to have telephone operator that offers you unlimited sms. Don't take me for a word (it was long time that I programm this app) but I think that is only 25 signs for 1 sms.

    • @zeeshanahmad1240
      @zeeshanahmad1240 Před 3 lety

      @@danielkrudolf i neet it for pos . send invoice sms to customer and owner. and daily report SMS to owner etc

    • @zeeshanahmad1240
      @zeeshanahmad1240 Před 3 lety

      @@danielkrudolf i think this model is not available now .recommend me any other USB modem

    • @danielkrudolf
      @danielkrudolf Před 3 lety

      @@zeeshanahmad1240 you could try with Mikrotik Ltap Mini (mikrotik.com/product/ltap_mini#fndtn-gallery)

  • @stepbrojafz
    @stepbrojafz Před 7 lety

    Can I send it to Multiple Contacts Sir?

    • @foxlearn
      @foxlearn  Před 7 lety

      You can use foreach to send multiple contact. thanks

    • @stepbrojafz
      @stepbrojafz Před 7 lety

      Fox Learn Thanks Sir! Can you send me the Example of that Code or Video ?
      scrow.0110@gmail.com

    • @foxlearn
      @foxlearn  Před 7 lety

      Sent. Thanks

  • @meetalijutt7021
    @meetalijutt7021 Před 5 lety

    Please send me code for sending sms with gsm to multiple mobiles numbers

    • @foxlearn
      @foxlearn  Před 5 lety

      Thank you for your suggestion !

  • @meetalijutt7021
    @meetalijutt7021 Před 5 lety

    please send me code for sending sms with to mutliple numbers

    • @foxlearn
      @foxlearn  Před 5 lety

      Thank you for your suggestion !

  • @lucasmauri92
    @lucasmauri92 Před 5 lety

    Hello, can u send source code pls? Thanks

    • @foxlearn
      @foxlearn  Před 5 lety

      You can find at my site. thank you !

  • @iksoftsolution8802
    @iksoftsolution8802 Před 4 lety

    it work but not received any sms still why?

    • @foxlearn
      @foxlearn  Před 4 lety

      Please check your code again, i think you miss something

  • @ammars1990
    @ammars1990 Před 4 lety

    I HAVE ONE QUESTION >>>>>HOW TO SEND ARABIC CHARACTER? AND THANK YOU

    • @brightscript
      @brightscript Před 3 lety

      I also have this problem, please help me too.

  • @jenelizagasang272
    @jenelizagasang272 Před 6 lety

    can you please send me codes

  • @danixunboxing
    @danixunboxing Před 4 lety

    Why you don't provide the source code??

    • @foxlearn
      @foxlearn  Před 4 lety +1

      You can find demo code at my website. I'll try to upload all soon. thank you !

  • @HaithamShaabanB
    @HaithamShaabanB Před 8 lety

    where is the code?

  • @HammadKhanYT
    @HammadKhanYT Před 6 lety +1

    Here is the code, but it will send "successful message" even if the GSM Modem is not connected
    try
    {
    SerialPort sp = new SerialPort();
    sp.PortName = txtPort.Text;
    sp.Open();
    sp.WriteLine("AT" + Environment.NewLine);
    Thread.Sleep(100);
    sp.WriteLine("AT+CMFG=1" + Environment.NewLine);
    Thread.Sleep(100);
    sp.WriteLine("AT+CSCS=\"GSM\"" + Environment.NewLine);
    Thread.Sleep(100);
    sp.WriteLine("AT+CMGS=\"" + txtPhone.Text + "\"" + Environment.NewLine);
    Thread.Sleep(100);
    sp.WriteLine(txtMessage.Text + Environment.NewLine);
    Thread.Sleep(100);
    sp.Write(new byte[] { 26 }, 0, 1);
    Thread.Sleep(100);
    var response = sp.ReadExisting();
    if (response.Contains("ERROR"))
    MessageBox.Show("SMS Failed");
    else
    MessageBox.Show("SMS Sent successfully");
    }
    catch (Exception ex)
    {
    MessageBox.Show(ex.Message);
    }

  • @LamNguyen-yj5ib
    @LamNguyen-yj5ib Před 8 lety

    Việt Nam code ? :D tks for share.

  • @user-ct5ht7ln1x
    @user-ct5ht7ln1x Před 2 lety

    i want send 100000 number in the same time is ther anther way

  • @rameezjaved725
    @rameezjaved725 Před 6 lety

    MessageBox with message 'Sent Successfully' shown but i'm not receiving the message?

  • @namtranquang8081
    @namtranquang8081 Před 4 lety

    bạn là người việt nam