Results 1 to 6 of 6

Thread: How to Send a Long SMS

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2009
    Location
    India
    Posts
    94

    Sending the SMS

    Dear All,

    I am sending the SMS more than 160 characters then it is sending that sms in two sms's but I want to send send that sms in one sms. My poert is send 160 characters only at a time. I am mentioning code bellow.
    vb Code:
    1. Public Sub SendSms(ByVal Number As String, ByVal Message As String)
    2. Dim messagetosend As String
    3.     messagetosend = Message
    4.     Debug.Print messagetosend
    5.     If Len(messagetosend) > 160 Then
    6. '            SendSms1 Number, Mid(messagetosend, 1, 160)
    7. '            SendSms1 Number, Mid(messagetosend, 160, 320)
    8.             SendSms1 Number, Mid(messagetosend, 1, 159)
    9.             SendSms1 Number, Mid(messagetosend, 160, 319)
    10.             Else
    11.               SendSms1 Number, Message
    12.     End If
    13.        
    14. End Sub
    15. Public Sub SendSms1(ByVal Number As String, ByVal Message As String)
    16. Dim i
    17. i = 0
    18. tempBuffer = ""
    19. Dim start
    20.  bGreaterSign = False
    21.  Message_sent = "False"
    22.  start = Timer
    23.  On Error Resume Next
    24.  MSComm1.Output = "AT+CMGS=" + Chr$(34) + Trim(Number) + Chr$(34) + vbCr
    25.  While Not bGreaterSign
    26.       DoEvents
    27.       Wait
    28.       If Timer > (start + 50) Then
    29.          MsgBox "Time Out"
    30.          Message_sent = "False"
    31.          Exit Sub
    32.       End If
    33.  Wend
    34.  
    35.    If bGreaterSign Then
    36.       MSComm1.Output = Trim(Message) + Chr$(26)
    37.       start = ""
    38.       start = Timer
    39.       bOK = False
    40.       bError = False
    41.       While Not bOK Or bError
    42.      
    43.                       Debug.Print tempBuffer
    44.                       If InStr(tempBuffer, "ERROR") Then
    45.                          Message_sent = "False"
    46.                          tempBuffer = ""
    47.                          Exit Sub
    48.                       End If
    49.                       Debug.Print Timer
    50.                 Debug.Print start + 50
    51.                 If Timer > (start + 50) Then
    52.                       MsgBox "Time out"
    53.                       Message_sent = "False"
    54.                       Exit Sub
    55.                   End If
    56.           DoEvents
    57.           Wait
    58.       Wend
    59.        If InStr(tempBuffer, "ERROR") Then
    60.          Message_sent = "False"
    61.          tempBuffer = ""
    62.          Exit Sub
    63.        End If
    64.      
    65.       If bOK Then
    66.          Message_sent = "True"
    67.       Else
    68.          Message_sent = "False"
    69.       End If
    70.    Else
    71.       Message_sent = "Not Possible"
    72.    End If
    73.    If bError Then MsgBox " FAILED"
    74. End Sub
    pls let me know the solution
    Last edited by Hack; Feb 9th, 2010 at 11:40 AM. Reason: Added Highlight Tags

  2. #2
    Frenzied Member HanneSThEGreaT's Avatar
    Join Date
    Nov 2003
    Location
    Vereeniging, South Africa
    Posts
    1,492

    Re: Sending the SMS

    I think that depends on the phone that receives the SMS's
    VB.NET MVP 2008 - Present

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2009
    Location
    India
    Posts
    94

    sendig the muliparat sms

    Dear All,
    I want to send the SMS to a partaicular person. That SMS is Two pages information. The reciever will recieve that SMS as one SMS for that is there any special AT commands? Please send me the solution as early as possible.
    Regards,
    VEnky

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Oct 2009
    Location
    India
    Posts
    94

    How to Send a Long SMS

    Dear All,
    Although the normal SMS limit is 160 words per page, many phones offer the option of automatically extending your single text into multiple messages without any additional effort on your part. As you type, the SMS will automatically move your excess words into a second or third message and send them to the recipient of your choice. This message wil be received as one long message on the recipient's cell phone.

    I Mentioned my requirement in the above for that please send me the sample code and AT Commands also as early as possible. It's urgent for me
    Regards,
    Venkat

  5. #5
    Fanatic Member
    Join Date
    Sep 2009
    Location
    Lakewood, Colorado
    Posts
    621

    Re: How to Send a Long SMS

    Does your modem support this operation? If so, then the documentation for the modem should describe the command(s). If I were to guess, my thought would be that it very well may not be "built-in." If not, then you would have to break the long message into smaller messages and send each separately. It may be -- though I've never looked into it, since SMS from desktop machines is quite unusual, this may be the only solution.

    Dick
    Richard Grier, Consultant, Hard & Software
    Microsoft MVP (Visual Basic)

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: How to Send a Long SMS

    Duplicate threads merged - please post each question (or variation of it) only once.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width