Send Messages From My WhatsApp web to Another Number using C#.NET
Hi all....,
Today we will discuss about sending messages through whatsapp web programmatically using c#.net.
it is not a rocket science. Whatsapp providing many API for your business integration. but these apis are not free. they are providing api to use in web application. We are overriding their web link to send customized messages.
follow these steps...
1. install whatsapp for desktop in your PC and set the account using QR code and your mobile.
https://www.whatsapp.com/download
2. Open Visual Studio and create a simple windows application form.
3. Place 2 text boxes for number and message.
4. Insert button for calling function.
5. it will direct you to whatsapp web.
CODE
=================
create a function like this
private void sendWhatsApp(string number,string message)
{
try
{
if (number == "")
{
MessageBox.Show("No number added");
}
if (number.Length <= 10)
{
MessageBox.Show("Inidan Code added automatically");
number = "+91" + number;
}
number = number.Replace(" ", "");
System.Diagnostics.Process.Start("http://api.whatsapp.com/send?phone=" + number + "&text=" + message);
}
catch (Exception ex)
{
}
}
call the function in button click event
private void btnSend_Click(object sender, EventArgs e)
{
sendWhatsApp(txtNumber.Text, txtMessage.Text);
}
Enjoy the code.

Thank you
ReplyDeletehow to send image with same way?
ReplyDeletethis is a free method, you can buy api for doing more from WhatsApp.
DeleteHow i can buy api kindly guide
Deletecan you explain it in more detail, because I am newbie in this field
ReplyDeleteWhich area
Deletehello dear,
ReplyDeletethanks for the code. but its not sending the text. how to send it by button click?
Regards
To send message automatically, You need to add timer control and start it while calling sendwhatsap function. As well as you need write down given code in timer tick event.
Deleteprivate void timer1_Tick(object sender, EventArgs e)
{
sec += 1;
if (sec == 20)
{
SendKeys.Send("{ENTER}");
timer1.Stop();
sec = 0;
}
}
It will write the same message to WhatsApp messenger to the specified number, but not send automatically if it is connected. I have to press sent button from desktop WhatsApp Application.
ReplyDeleteI there any way to send it automatically from the link http://api.whatsapp.com/send?phone=" + number + "&text=" + message
To send message automatically, You need to add timer control and start it while calling sendwhatsap function. As well as you need write down given code in timer tick event.
Deleteprivate void timer1_Tick(object sender, EventArgs e)
{
sec += 1;
if (sec == 20)
{
SendKeys.Send("{ENTER}");
timer1.Stop();
sec = 0;
}
}To send message automatically, You need to add timer control and start it while calling sendwhatsap function. As well as you need write down given code in timer tick event.
private void timer1_Tick(object sender, EventArgs e)
{
sec += 1;
if (sec == 20)
{
SendKeys.Send("{ENTER}");
timer1.Stop();
sec = 0;
}
}
To send message automatically, You need to add timer control and start it while calling sendwhatsap function. As well as you need write down given code in timer tick event.
ReplyDeleteprivate void timer1_Tick(object sender, EventArgs e)
{
sec += 1;
if (sec == 20)
{
SendKeys.Send("{ENTER}");
timer1.Stop();
sec = 0;
}
}
hello,do you know how to send whatsapp message but from asp.net web api. please and thank you
DeleteNice Post...
ReplyDeletewhatsapp-for-windows-crack
hello, could you help with the same thing but by using asp.net mvc for web api. please and thank you
ReplyDelete