How to Send free SMS Message in C#
By FoxLearn 7/17/2024 4:13:11 AM 8.21K
To send free SMS messages using ipipi.com in a C# Windows Forms Application, you'll follow a similar approach to the one outlined earlier.
Open your Visual Studio, then create a new project called FreeSms.
To send an SMS message using the ipipi.com service in C#, you can use their HTTP API. Here's a basic example of how you can do this using the SmtpClient
class:
Drag and drop Label, Button, Textbox controls from the Visual Studio toolbox onto your form designer, then you can design your form as shown below.
Adding a click event handler to the Send button that allows you to send a sms message in c#.
private void btnSend_Click(object sender, EventArgs e) { try { SmtpClient smtp = new SmtpClient(); MailMessage message = new MailMessage(); smtp.Credentials = new NetworkCredential(txtUsername.Text, txtPassword.Text); smtp.Host = "ipipi.com"; message.From = new MailAddress(string.Format("{0}@ipipi.com", txtUsername.Text)); message.To.Add(string.Format("{0}@sms.ipipi.com", txtPhone.Text)); message.Subject = "FoxLearn"; message.Body = txtMessage.Text; smtp.Send(message); MessageBox.Show("Your message has been successfully sent.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
To play demo, You need to create an account at ipipi website
VIDEO TUTORIAL
Categories
Popular Posts
How to download redis for Windows
10/29/2024