使用asp.net在twilio中发送短信

时间:2015-04-08 08:34:55

标签: asp.net random twilio

twilio与我合作但我需要将消息发送到用户在文本框中输入的数字(文本框的名称是Phone_no)

  var phone = Phone_no.Text;
               var randomCode = rnd.Next(100000, 1000000);
                Session["codeNo"] = randomCode;

              var message = new TwilioRestClient(AccountSid, AuthToken);

                  var sms = message.SendMessage("Caller ID", "phone" , "Your code is: " + randomCode, "");
                  Console.WriteLine(sms.Sid);
                Response.Redirect("nextpage.aspx");

你能帮帮我吗

1 个答案:

答案 0 :(得分:0)

试试这个

       var phone = Phone_no.Text;
       var randomCode = rnd.Next(100000, 1000000);
        Session["codeNo"] = randomCode;

      var message = new TwilioRestClient(AccountSid, AuthToken);

          var sms = message.SendMessage("Caller ID", phone , "Your code is: " + randomCode, "");
          Console.WriteLine(sms.Sid);
        Response.Redirect("nextpage.aspx");