Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Here is my text

Dear Member, your 3000 Points will expire on 31-08-2017. Redeem them along with the 3000 exchange points as loyalty benefit to buy a new car. Visit your nearest dealership or www.marutiautocard.com to redeem. T&C apply.


but when i send sms I receive only

Dear Member, your 3000 Points will expire on 31-08-2017. Redeem them along with the 3000 exchange points as loyalty benefit to buy a new car. Visit your nearest dealership or www.marutiautocard.com to redeem. T


It left tcharacters after T

What I have tried:

ret = String.Empty
           Dim w As WebRequest = WebRequest.Create("http://180.179.104.9/smspush-enterprise/api/push")
           System.Net.ServicePointManager.Expect100Continue = False

           w.Method = "POST"
           w.ContentType = "application/x-www-form-urlencoded"
           Dim AutoCardSenderName As String = "MARUTI"
           Using writeStream As Stream = w.GetRequestStream()
               Dim encoding As UTF8Encoding = New UTF8Encoding()
               'MSG = MSG.Replace("&", "&")
               Dim bytes() As Byte = encoding.GetBytes("accesskey=SKt8r0w7Q3OI8rZUWLwiANpbDpLCt2&to=" + mobileno + "&text=" + MSG + "&from=" & AutoCardSenderName)

               writeStream.Write(bytes, 0, bytes.Length)

           End Using
           Using r As HttpWebResponse = w.GetResponse()
               Using responseStream As Stream = r.GetResponseStream()
                   Using readStream As New StreamReader(responseStream, Encoding.UTF8)
                       ret = readStream.ReadToEnd()
                       If ret.ToUpper().Contains("SUCCESS") = True Then
                           boolStatus = True
                       End If

                   End Using
               End Using
           End Using
       Catch ex As Exception
           boolStatus = False
           ret = ex.Message
       Finally

       End Try
       Return boolStatus
   End Function
Posted
Updated 21-Aug-17 20:17pm
Comments
Graeme_Grant 22-Aug-17 2:03am    
Sounds like you have hit a character limit. You need to check the documentation.

1 solution

Since you are sending via html you should encode the special characters i.e. & = & amp ; (without the spaces - the editor here changes it)
HTML Codes - Table of ascii characters and symbols[^]
 
Share this answer
 
v2
Comments
Member 12962919 22-Aug-17 2:47am    
i already tried to replace & with & but its not work

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900