|
-
Feb 9th, 2010, 05:58 AM
#1
Thread Starter
Lively Member
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:
Public Sub SendSms(ByVal Number As String, ByVal Message As String)
Dim messagetosend As String
messagetosend = Message
Debug.Print messagetosend
If Len(messagetosend) > 160 Then
' SendSms1 Number, Mid(messagetosend, 1, 160)
' SendSms1 Number, Mid(messagetosend, 160, 320)
SendSms1 Number, Mid(messagetosend, 1, 159)
SendSms1 Number, Mid(messagetosend, 160, 319)
Else
SendSms1 Number, Message
End If
End Sub
Public Sub SendSms1(ByVal Number As String, ByVal Message As String)
Dim i
i = 0
tempBuffer = ""
Dim start
bGreaterSign = False
Message_sent = "False"
start = Timer
On Error Resume Next
MSComm1.Output = "AT+CMGS=" + Chr$(34) + Trim(Number) + Chr$(34) + vbCr
While Not bGreaterSign
DoEvents
Wait
If Timer > (start + 50) Then
MsgBox "Time Out"
Message_sent = "False"
Exit Sub
End If
Wend
If bGreaterSign Then
MSComm1.Output = Trim(Message) + Chr$(26)
start = ""
start = Timer
bOK = False
bError = False
While Not bOK Or bError
Debug.Print tempBuffer
If InStr(tempBuffer, "ERROR") Then
Message_sent = "False"
tempBuffer = ""
Exit Sub
End If
Debug.Print Timer
Debug.Print start + 50
If Timer > (start + 50) Then
MsgBox "Time out"
Message_sent = "False"
Exit Sub
End If
DoEvents
Wait
Wend
If InStr(tempBuffer, "ERROR") Then
Message_sent = "False"
tempBuffer = ""
Exit Sub
End If
If bOK Then
Message_sent = "True"
Else
Message_sent = "False"
End If
Else
Message_sent = "Not Possible"
End If
If bError Then MsgBox " FAILED"
End Sub
pls let me know the solution
Last edited by Hack; Feb 9th, 2010 at 11:40 AM.
Reason: Added Highlight Tags
-
Feb 9th, 2010, 07:15 AM
#2
Re: Sending the SMS
I think that depends on the phone that receives the SMS's
VB.NET MVP 2008 - Present
-
Feb 11th, 2010, 02:25 AM
#3
Thread Starter
Lively Member
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
-
Feb 11th, 2010, 02:32 AM
#4
Thread Starter
Lively Member
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
-
Feb 11th, 2010, 12:25 PM
#5
Fanatic Member
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)
-
Feb 11th, 2010, 02:11 PM
#6
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|