Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public string SendSMS(string number)
- {
- Stream streamMsg = new MemoryStream();
- string responceMsgStr = string.Empty;
- string transactionId = GetTransactionId();
- string password = GetPassword();
- using (var client = new WebClient())
- {
- try
- {
- var values = new NameValueCollection
- {
- { "TransactionId", transactionId },
- { "PhoneNumber", number },
- { "Message", "The OTP for digital application is "+ password + ". Please use this OTP to complete the application."},
- { "Priority", "1" },
- { "User", "SMS123" },
- { "Password", "qw12@!" }
- };
- var response = client.UploadValues(Properties.Settings.Default.otp, values);
- var responseString = Encoding.Default.GetString(response);
- return password;
- }
- catch (Exception ex)
- {
- return "1111";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement