In this article I’m going to show
you "How to
Send WhatsApp Message by Using C# Coding", first design Web Application
as shown in above image. Before writing code to send WhatsApp message first we
need to Install WhatsApp API in our
application, based on this WhatsApp API we can create object for
WhatsApp. By using WhatsApp Object we can call WhatsApp Methods.
WhatsApp Methods: OnConnectSuccess, OnLoginSuccess , OnLoginFailed, OnConnectFailed
First Download WART tools from this Link WART Tools
After Download, you can run WART.exe file.
Enter your mobile number with area code and enter password
which is associate with your WhatsApp account. Now, click on “Request Code” Button which
will get you 4 digit confirmation code in your registration mobile number.
Enter confirmation
code and click on Confirmation code which will display password. Please Note
down this generated password. This password is enter in password field at run
time of project.
Now Design your Webpage like below.
Write code on “Send” button
click event.
protected void BtnSEND_Click(object
sender, EventArgs e)
{
string
number = "91**********"; // use number which is register from WART tool
string to =
txtTo.Text;
string msg =
txtMSG.Text;
string
password = "*****************************";
// use here password which is generated from WART
tool
WhatsApp
wa = new WhatsApp(number,
password, "Nickname", true); // nickname u can
provide any name
wa.OnConnectSuccess += () =>
{
Response.Write("connect");
wa.OnLoginSuccess +=
(phoneNumber, data) =>
{
Response.Write("connection successfully");
wa.SendMessage(to/* Number */, msg);
Response.Write("Sent Successfully");
};
wa.OnLoginFailed += (data)
=>
{
Response.Write("login failed" + data);
};
wa.Login();
};
wa.OnConnectFailed += (ex) =>
{
Response.Write("connection failed: {0}" +
ex.StackTrace);
};
wa.Connect();
}
Now you are ready to
Send Message in Asp.Net Web Application through WhatsApp Application.
29 comments
commentsHad issue with Login, It says unauthorized
ReplyCould you please help me with OnLoginSuccess method
i am getting an error "Unauthorized"
ReplyCould you please help me resolving this error
have you enter valida mobile number and password generated from WART tools and Whatsapp.dll reference in your projects.
Replywhere I download Whatsapp.dll file
ReplyHad issue with Login, It says unauthorized
ReplyCould you please help me with OnLoginSuccess method.
my email id is info.cgiit@gmail.com
I alway have an error in wa.Login(), it says Auth response error. I have changed the dll and have the password from http://www.watools.es/pwd.html, because WART throws bad_token. Any ideas??
ReplyI have same problem with Logn
ReplyPlease send me source code is still working
riidhoTKJ@gmail.com
the message is not getting sent for me
ReplyI m get error an Un Authorized,
ReplyCan u give me the solution on my email id : dhruv4yug@gmail.com
I am not getting the password from WART.exe. I got the error message saying that "bad-token". Can somebody plse tell me the reason for this?
ReplyI m getting error from WART and also not able to get password from online URL.
ReplyCould you please help me for this, Its really urgent.
mohitj786@gmail.com
Getting same error from wart
Replybut if you enter number from out side of india thats working
www.metrosms.in
Whatsapp Messenger for mobile Using the Whatsapp app, all you need is an internet connection for your phone to connect with other people
ReplyAnybody have working dll for WhatsApp ??? A have method request Code for send sms and i get password, but Error Auth() ((((
ReplyPlease contact alien-kms@mail.ru
ReplySend bad_token error and look for it and I do not know what it is
Hi got the wa password but always authorization error, any ideas?
ReplyThanks Sarita Kumari and Sujitkumar.
Replywart is not working.
ReplyI got this error {"login":"91xxxxxx8878","status":"fail","reason":"bad_token"}. If working Whatsapp registration tool or working source code you have please help me. Mail: mvinoth248@gmail.com
Replywill please mail me the whats app code :
Replymutharaju.kk@gmail.com
the WART tool is not working..unable to get password. says old version...
Replywhat to do ?
I got this error {"login":"91xxxxxx7781","status":"fail","reason":"old_version"}. If working Whatsapp registration tool or working source code you have please help me. Mail: mvinoth248@gmail.com
ReplyGood Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging…
ReplyDot Net Training in Chennai | Dot Net Training in anna nagar | Dot Net Training in omr | Dot Net Training in porur | Dot Net Training in tambaram | Dot Net Training in velachery
Hello There. I found your blog using msn. This is an extremely well written article. I will be sure to bookmark it and return to read more of your useful information. Thanks for the post. I’ll certainly comeback. read
ReplyI am really happy with your blog because your article is very unique and powerful information...Very informative article.Thank you admin for you valuable points.Keep Rocking..
ReplySalesforce Training in Chennai
Salesforce Online Training in Chennai
Salesforce Training in Bangalore
Salesforce Training in Hyderabad
Salesforce training in ameerpet
Salesforce Training in Pune
Salesforce Online Training
Salesforce Training
Great Article Cloud Computing Projects
ReplyNetworking Projects
Final Year Projects for CSE
JavaScript Training in Chennai
JavaScript Training in Chennai
The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training
Hi,
ReplyUnable to download WART Tools. so couldn't generate password.
How to get password?
Without password we cant use this code.
WhatsApp API
ReplyWe provide best WhatsApp API services across India. Send promotional Bulk SMS Marketing or buy WhatsApp Bulk Marketing Software to grow your business with Mart2global.
Infycle Technologies in Chennai offers the leading Big Data Hadoop Training in Chennai for tech professionals and students at the best offers. In addition to the Python course, other in-demand courses such as Data Science, Big Data Selenium, Oracle, Hadoop, Java, Power BI, Tableau, Digital Marketing also will be trained with 100% practical classes. Dial 7504633633 to get more info and a free demo.
ReplyThanks for comments.....