private void Send_Button_Click(object sender, EventArgs e) { bool flag = SMTPClient.Send(To_textbox.Text, Subject_textbox.Text, Message_textbox.Text); if (flag == true) { Status_textbox.Text = "Sucess ! 1 Email send from the nr 1 email client"; To_textbox.Text = string.Empty; Subject_textbox.Text = string.Empty; Message_textbox.Text = string.Empty; } else { Status_textbox.Text = "Error ! you f****d up.. sorry..."; } }
public MailClient() { this.Load += MailClient_Load; InitializeComponent(); pop3 = new POPClient(); smtp = new SMTPClient(); dbHandler = new DBHandler(); POP3Worker = new BackgroundWorker(); POP3Worker.WorkerReportsProgress = true; POP3Worker.DoWork += new DoWorkEventHandler(pop3.GetAllMails); POP3Worker.ProgressChanged += new ProgressChangedEventHandler(WorkerProgressChanged); POP3Worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(WorkerRunCompleted); SMTPWorker = new BackgroundWorker(); SMTPWorker.DoWork += new DoWorkEventHandler(smtp.Send); SMTPWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(sendWorkerRunCompleted); }