Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.67 KB | None | 0 0
  1. public string sendSMS(string usernumber, string OTPCode)
  2.     {
  3.         String message = HttpUtility.UrlEncode("This is your OTP : " + OTPCode + ". This will expire in 30 seconds.");
  4.         using (var wb = new WebClient())
  5.         {
  6.             byte[] response = wb.UploadValues("https://api.txtlocal.com/send/", new NameValueCollection()
  7.                 {
  8.                 {"apikey" , "x8rWcDHLA5k-fFTonLa0MTvLqhe1Y4YqMi9LV2YbkU"},
  9.                 {"numbers" , usernumber},
  10.                 {"message" , message},
  11.                 {"sender" , "OTP"}
  12.                 });
  13.             string result = Encoding.UTF8.GetString(response);
  14.             return result;
  15.         }
  16.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement