I'm trying to learn how to tinker with twilio by applying it to a same test project in ASP.NET MVC 5.
In the middle of my Google dig, I found this tutorial here that explains how to use it.
I did everything according to what is in this tutorial, but at the time of testing, I even get the message that the SMS was sent, but I do not receive any messages in my number ....
I do not know if I'm doing something wrong in my code, or if I'm making a mistake in the configuration on the site itself. I know that Brazilian numbers generated by twilio do not send a message yet, so I ended up creating another account and changing the number, since free account can not change numbers.
I also know that we can use test credentials to send messages without the need to pay for it. But they even work, but nothing to get message ...
Finally, I'll put here the controller (although I think the problem is in my account) so that someone can help me.
Controller
public ActionResult Index()
{
ViewBag.SendSmsResultMessage = TempData.ContainsKey("SendSmsResultMessage") ? TempData["SendSmsResultMessage"] : String.Empty;
return View();
}
[HttpPost]
public ActionResult SendSms(string sid, string token, string fromPhoneNumber, string toPhoneNumber, string message)
{
var twilioClient = new TwilioRestClient(sid, token);
var sendMessageResult = twilioClient.SendMessage(fromPhoneNumber, toPhoneNumber, message, "");
if (sendMessageResult.RestException == null)
TempData["SendSmsResultMessage"] = "Mensagem enviada com sucesso!";
else
TempData["SendSmsResultMessage"] = "Houve um erro durante a tentativa de enviar a mensagem: " + sendMessageResult.RestException.Message;
return RedirectToAction("Index");
}
Has anyone used their service to help me? Is there another tutorial on how to create numbers and make this test submission?