locked
Send SMS using modem RRS feed

  • Question

  • Hello Friends

    I am trying to implement automated sms(Short Msg ) system.I implemented sms receiving part.but I could't send a sms as reply.

    Please if you can help me.

    Thank you. 

    Friday, May 11, 2012 12:06 AM

Answers

All replies

  • Oh I am Very sorry.I am using visual basic only friend.because I have no better knowledge about C#.net.most of your examples are in c#.net.some of not working in my version(visual basic express 2010).

    Please if u can tell me that is there having some errors in below code fragment.

     Public Sub SendMessage(ByVal Message As String, ByVal PhoneNumber As String)
            Dim m1 As String = ""
            Dim i As Integer = 150
            Do While Message.Length > 0
                If Message.Length > i Then
    
                    m1 = Message.Substring(0, i)
    
                    MsgBox("" & m1)
                    Me.SerialPort1.WriteLine("AT+CMGS=""" + PhoneNumber + """")
                    Threading.Thread.Sleep(100)
                    Me.SerialPort1.Write((m1 + ChrW(26)))
    
    
                    Message = Message.Remove(0, i)
                Else
                    Me.SerialPort1.WriteLine("AT+CMGS=""" + PhoneNumber + """")
                    Threading.Thread.Sleep(100)
                    Me.SerialPort1.Write((Message + ChrW(26)))
                    Message = ""
                End If
                Threading.Thread.Sleep(5000)
            Loop
    
    
        End Sub
    

     thank you

    Friday, May 11, 2012 3:48 PM
  • Theirs some wcf/soap services that can do this and they are easy to use to send an sms message:

    http://www.csoft.co.uk/sms/api/soap_to_sms.htm

    Thats one but their are hundreds more floating around the internet that make making an sms sending message application easy.

    heres my bing search if that doesnt help you so you can find a better one but i would look up soap/wcf services because they make life easier when doing sms messages so you dont code the hard stuff just use/consume the service:

    http://www.bing.com/search?q=soap%20service%20to%20send%20sms%20message&sc=0-32&form=BB07LB&pc=BB07&QS=n

    Why over the modem if its connected to internet cant you use web service? 

    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda. Blog - http://jefferycarlsonblog.blogspot.com/



    • Proposed as answer by The Thinker Friday, May 11, 2012 4:00 PM
    • Edited by The Thinker Friday, May 11, 2012 4:01 PM
    • Marked as answer by Youen Zen Thursday, May 24, 2012 7:52 AM
    Friday, May 11, 2012 3:58 PM
  • Hi Lucky,

    Welcome to the MSDN forum.

    Could you please provide us the detailed exception about your code snip? As for codes in C#, if you want to use them in VB.NET, you can convert them into VB.NET by a tool like this.

    I'm looking forward to your feedback.

    Best regards,


    Shanks Zen
    MSDN Community Support | Feedback to us

    Monday, May 14, 2012 6:19 AM
  • I believe maziyar has talked about development using other means if you need them. I can help you convert from c# to vb.net if its less then 100 lines of code to go through.

    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda. Blog - http://jefferycarlsonblog.blogspot.com/

    Thursday, May 24, 2012 1:55 PM