private void RefreshButton_Click(object sender, EventArgs e) { d.Clear(); listBox1.Items.Clear(); Message[] incomingMail = NetComms.GetMail(); //Console.WriteLine("mail retrieved"); if (incomingMail != null && incomingMail.Length != 0) { foreach (Message m in incomingMail) { d.Add(listBox1.Items.Count, m); listBox1.Items.Add(m.sender + ": " + m.subject); } } }
private void SendButton_Click(object sender, EventArgs e) { NetComms.SendMail(new Message(subjectBox.Text, bodyBox.Text, rcptBox.Text, SettingsForm.sMTPName, DateTime.Now.ToString("F"))); this.Close(); }