public JsonResult SendMessage(string sendTo,string message) { var response = false; string from = "91XXXXXXXXXX"; //(Enter Your Mobile Number) String password; var res = WhatsAppApi.Register.WhatsRegisterV2.RequestCode(from, out password); WhatsApp wa = new WhatsApp(from, password, "abc.com", false, false); wa.OnConnectSuccess += () => { wa.OnLoginSuccess += (phonenumber, data) => { wa.SendMessage(sendTo, message); response = true; }; wa.OnLoginFailed += (data) => { response = false; }; wa.Login(); }; wa.OnConnectFailed += (Exception) => { response = false; }; return Json(response); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)