I tried this code and getting the exception like this
{"message":"Invalid Mashape Key"}
An exception of type System.Exception occurred in ASPSnippets.SmsAPI.dll but was not handled in user code
What I have tried:
public void sent()
{
bool isSent = SendOTPSMS("&&&&&&****", "*****", "NHa1bjKulkmshpU91Xel3gj94SDKp18z3qcjsnCuDyxq7OOePV", "++++++@@@@", "OTP: 324353");
}
public static bool SendOTPSMS(string senderMobileNo, string senderPassword, string MshapeKey, string receiverMobileNo, string Message)
{
bool isSent = true;
try
{
WebRequest request = WebRequest.Create("https://site2sms.p.mashape.com/index.php?msg="
+ Message + "&phone=" + receiverMobileNo + "&pwd=" + senderPassword + "&uid=" + senderMobileNo);
request.Headers.Add("X-Mashape-Key", MshapeKey);
WebResponse response = request.GetResponse();
return isSent;
}
catch (Exception ex)
{
return false;
}
}