private void OnSendMailButtonClick(object sender, EventArgs e) { if (sender == send_mail_button.button) { String account_name = "Delaar88"; String account_password = "******"; String mail_to = text_field_to.GetTextBoxContent(); String subject = text_field_subject.GetTextBoxContent(); String content = edit_mail_text_label.GetTextBoxContent(); List <String> attachments = edit_mail_text_label.GetListBoxContent(); //text_field_to. mail_sender.ConfigureSmtpClient(account_name, account_password); mail_sender.WriteNewMail("*****@*****.**", mail_to, subject, content); mail_sender.AddAttachments(attachments); mail_sender.SendMessage(); } }