using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Web;
using System.Net.Mail;
namespace Question7
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
MailMessage mail = new MailMessage(From.Text, to.Text, subject.Text, richTextBox1.Text);
SmtpClient client = new SmtpClient(smtp.Text);
client.Port = 587;
client.Credentials = new System.Net.NetworkCredential(username.Text, pass.Text);
client.EnableSsl = true;
client.Send(mail);
MessageBox.Show("Your Message Has Been Delivered Successfully");
}
}
}
Write a program that sends an email. Also validate Sender and Receiver Email address.
Post A Comment:
0 comments: