Windows Forms: Send free SMS Message in C#
By FoxLearn 5/26/2017 10:07:53 PM 7.81K
How to send free sms message in C#
Step 1: Create a new project called FreeSms
Step 2: Design your form as below
Add code to handle btnSend event click
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 TUTORIALS
Categories
Popular Posts
Visual Studio: Auto increment version
04/01/2024
What is ARM architecture?
04/01/2024
How to use Factory Method Pattern in C#
02/16/2024