Skip to main content

Sending SMS Code in C#.Net

 
Please find below code for sending SMS
/// <summary>
        /// Sends SMS
        /// </summary>
        /// <returns> Returns true if SMS sent successfully </returns>

  private bool SendSMS()
        {
            try
            {
                if (string.IsNullOrEmpty(txtSMSPhoneNumber.Text.Trim()))
                {
                    MessageBox.Show("Please enter Phone Number to send SMS", "SMS Validation",
                        MessageBoxButtons.OK, MessageBoxIcon.Information);

                    txtSMSPhoneNumber.Focus();
                    return false;
                }
                if (txtSMSPhoneNumber.Text.Trim().Length < 10)
                {
                    MessageBox.Show("Invalid Phone Number. Please enter valid Phone Number", "SMS Validation",
                        MessageBoxButtons.OK, MessageBoxIcon.Information);

                    txtSMSPhoneNumber.Focus();
                    return false;
                }
                if (string.IsNullOrEmpty(txtSMSText.Text.Trim()))
                {
                    MessageBox.Show("Please text to SMS", "SMS Validation",
                        MessageBoxButtons.OK, MessageBoxIcon.Information);

                    txtSMSText.Focus();
                    return false;
                }

                string SMSText = txtSMSText.Text.Trim().Replace(" ", "");
                StringBuilder SMSURL = new StringBuilder();
                SMSURL.Append("http://smsoutbox.info/?user=Abm&password=abm567&PhoneNumber=91");
                SMSURL.Append(txtSMSPhoneNumber.Text.Trim());
                SMSURL.Append("&Text=");
                SMSURL.Append(SMSText);
                SMSURL.Append("&Sender=Minacs");

                //ProcessStartInfo PSInfo = new ProcessStartInfo("http://www.google.co.in/");
                //PSInfo.WindowStyle = ProcessWindowStyle.Minimized;
                //PSInfo.CreateNoWindow = true;
                //Process.Start(PSInfo);

                Process.Start(SMSURL.ToString());

                ShowWaiting("Sending SMS");
                return true;
            }
            catch (Exception ex)
            {
                throw new Exception("Error in Function TestCustInfo.SendSMS. Error Message :- "
                    + ex.Message, ex);
            }
        }

Comments

  1. Hi there! This blog post could not be written any better!
    Going through this post reminds me of my previous roommate!

    He always kept preaching about this. I will forward this article to him.
    Pretty sure he's going to have a very good read. Thank you for sharing!

    Visit my web blog: clickbank review

    ReplyDelete
  2. Can you furnish additional information on this?

    Here is my homepage :: small business to start

    ReplyDelete
  3. I Preserve hearing towards the news speak just about acquiring free of charge on-line grant applications so I've been looking about for the optimal website to get one.

    my page ... resources

    ReplyDelete
  4. Hi, I usually do not recognize that, if the spot of their own RSS reader.
    Can you enable please:)

    Feel free to visit my blog post ... billigreisen türkei

    ReplyDelete
  5. Of course, as a vital internet site and informative posts I will give it back hyperlink - Bookmark this page?
    Regards

    Feel free to surf to my site - affiliate

    ReplyDelete
  6. Asking questions are actually nice thing if you are not understanding something entirely,
    but this paragraph presents good understanding yet.

    Also visit my weblog ... tono ()

    ReplyDelete
  7. Nice post. I learn something totally new and challenging
    on blogs I stumbleupon everyday. It will always be useful to read content from other
    authors and use something from their web sites.

    Visit my page :: sunken

    ReplyDelete
  8. Thanks for sharing your thoughts about rasos.
    Regards

    Also visit my website - dcolumn

    ReplyDelete
  9. Hi! This is kind of off topic but I need some guidance from an established blog.
    Is it tough to set up your own blog? I'm not very techincal but I can figure things out pretty fast. I'm thinking about making my own but I'm not sure where to start. Do you have any points or suggestions? Cheers

    Here is my web-site; watches ()

    ReplyDelete
  10. What's up to all, how is all, I think every one is getting more from this website, and your views are fastidious designed for new people.

    Here is my web site - laudeer

    ReplyDelete
  11. Could you please tell on which site we need to register for this? Is it free and available in India?

    ReplyDelete
  12. Thanks for sharing. This blog is so informative for providing a valuable information about sending sms api c#.

    ReplyDelete

Post a Comment

Popular posts from this blog

Tab Control in Asp.Net

Scenerio: I need your help in designing tab control in   asp.net .My requirement is I need a tab control in   asp.net (C#) like  for example goto my computer ,right click c drive and select properties.we get tabs like general,security etc....... like that i need to design one tab control(no need of any rightclick) in my web page and the database table columns should come as tabs and inseide the tab data of that particular column should come.   Example:Employee master tab1:Employee name.........his name in the tab tab2:Age.............his age tab3:Address........his address   Solution:   You can do this using a simple div <style type="text/css"> .tabs         {             position: relative;             height: 20px;             margin: 0;   ...

AI and Microsoft: Revolutionizing Efficiency in Nonprofit Organizations

  How AI and Microsoft Enhance Efficiency in Nonprofit Organizations In today’s fast-paced world, nonprofit organizations face unique challenges—limited resources, increasing demands, and the constant need to do more with less. But what if technology could be the game-changer they need? In my latest research paper,  "How AI and Microsoft Enhance Efficiency in Nonprofit Organizations" , I explore how cutting-edge technologies like Artificial Intelligence (AI) and Microsoft’s innovative tools are revolutionizing the way nonprofits operate. From streamlining administrative tasks to enhancing donor engagement and optimizing resource allocation, AI and Microsoft’s solutions are empowering nonprofits to focus on what truly matters—their mission. This paper dives deep into real-world examples, practical applications, and the transformative potential of these technologies. Whether you’re a nonprofit professional, a tech enthusiast, or simply curious about the intersection of technolo...

Social tagging overview in Sharepoint 2010

A tag is a word or phrase that identifies an individual piece of information according to a set of attributes or criteria. Tags make it easy to find and share information about a specific subject or task. Social tagging helps users categorize information in ways that are meaningful to them. Social tagging can improve the quality of search results by filtering against specific tags, and it can also connect individuals who want to share information with other users who have like interests. This article describes the social tagging features in Microsoft SharePoint Server 2010. This article does not describe how to configure social tagging features. It also does not discuss how to implement social tagging features as part of an overall social media strategy for an enterprise. About using social tagging features Social tagging features help users to share information and to retrieve relevant, high-quality content more efficiently. Such sharing encourages collaboration and b...