Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public string sendSMS(string usernumber, string OTPCode)
- {
- String message = HttpUtility.UrlEncode("This is your OTP : " + OTPCode + ". This will expire in 30 seconds.");
- using (var wb = new WebClient())
- {
- byte[] response = wb.UploadValues("https://api.txtlocal.com/send/", new NameValueCollection()
- {
- {"apikey" , "x8rWcDHLA5k-fFTonLa0MTvLqhe1Y4YqMi9LV2YbkU"},
- {"numbers" , usernumber},
- {"message" , message},
- {"sender" , "OTP"}
- });
- string result = Encoding.UTF8.GetString(response);
- return result;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement