Any particular reason you don't use HttpClient for the request? I thought that 
was the direction MS was pushing people in these days.
    On Sunday, 23 May 2021, 03:38:56 am GMT+1, Greg Harris 
<harris.gre...@gmail.com> wrote:  
 
 Click Send just worked - Happy - Thanks for your help on this :-)
    private String SendSmsMessage_ClickSend( String aTargetPhoneNumber, String 
aMsg )
    {
      String lBaseUrl         = "https://api-mapper.clicksend.com/http/v2";;
      String lApiKey          = "";
      String lUsername        = "";
      String lTarget          = aTargetPhoneNumber.Trim().StartsWith("04") ? 
$"+614{aTargetPhoneNumber[2..]}" : aTargetPhoneNumber;
      String lMsg             = aMsg.Replace( " ", "%20" );
      String lRequestStr      = 
$"{lBaseUrl}/send.php?method=http&username={lUsername}&key={lApiKey}&to={lTarget}&message={lMsg}";
 
      // 
https://api-mapper.clicksend.com/http/v2/send.php?method=http&username=xxxx&key=xxxx&to=xxxx,yyyy,zzzz&message=xxxx

      WebRequest  lRequest    = WebRequest.Create( lRequestStr );
      WebResponse lResponse   = lRequest.GetResponse();
      String      lResult     = 
$"{((HttpWebResponse)lResponse).StatusDescription}";
      lResponse.Close();
      return lResult;
    }

On Sun, May 23, 2021 at 9:06 AM Greg Keogh <gfke...@gmail.com> wrote:

We've been using MessageNet for 15 years, still using their SOAP service (nice 
of them to keep it going!) No dependencies at all -- Greg K
  

Reply via email to