Last post Jul 22, 2020 02:38 AM by XuDong Peng
Member
19 Points
84 Posts
Jul 21, 2020 08:52 AM|sanam13|LINK
Hlo Professionals!
I want to send message from c# to whatsapp mobile no. but message can't be send.
Here is my code
Please execute it.
cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using WindowsFormsApp2; using WhatsAppApi; namespace WindowsFormsApp2 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { string from = "917009390171"; //(Enter Your Mobile Number) string to = txt_to.Text; string msg = txt_msg.Text; WhatsApp wa = new WhatsApp(from, "%e3%27%5cb%eb%ffx%22%2c%28%0er%7c%87%5d%d6%c5k%7f%e1", "NickName", false, false); wa.OnConnectSuccess += () => { MessageBox.Show("Connected to WhatsApp..."); wa.OnLoginSuccess += (phonenumber, data) => { wa.SendMessage(to, msg); MessageBox.Show("Message Sent..."); }; wa.OnLoginFailed += (data) => { MessageBox.Show("Login Failed : {0} : ", data); }; wa.Login(); }; wa.OnConnectFailed += (Exception) => { MessageBox.Show("Connection Failed..."); }; } } }
Contributor
2110 Points
674 Posts
Jul 22, 2020 02:38 AM|XuDong Peng|LINK
Hi sanam13,
sanam13 I want to send message from c# to whatsapp mobile
To send message to WhatsApp using C#, if possible, you could try "Twilio API for WhatsApp C#/.NET ".
Best regards,
Xudong Peng
Member
19 Points
84 Posts
message not shown in whatsapp?
Jul 21, 2020 08:52 AM|sanam13|LINK
Hlo Professionals!
I want to send message from c# to whatsapp mobile no. but message can't be send.
Here is my code
Please execute it.
cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using WindowsFormsApp2; using WhatsAppApi; namespace WindowsFormsApp2 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { string from = "917009390171"; //(Enter Your Mobile Number) string to = txt_to.Text; string msg = txt_msg.Text; WhatsApp wa = new WhatsApp(from, "%e3%27%5cb%eb%ffx%22%2c%28%0er%7c%87%5d%d6%c5k%7f%e1", "NickName", false, false); wa.OnConnectSuccess += () => { MessageBox.Show("Connected to WhatsApp..."); wa.OnLoginSuccess += (phonenumber, data) => { wa.SendMessage(to, msg); MessageBox.Show("Message Sent..."); }; wa.OnLoginFailed += (data) => { MessageBox.Show("Login Failed : {0} : ", data); }; wa.Login(); }; wa.OnConnectFailed += (Exception) => { MessageBox.Show("Connection Failed..."); }; } } }
Contributor
2110 Points
674 Posts
Re: message not shown in whatsapp?
Jul 22, 2020 02:38 AM|XuDong Peng|LINK
Hi sanam13,
To send message to WhatsApp using C#, if possible, you could try "Twilio API for WhatsApp C#/.NET ".
Best regards,
Xudong Peng