示例#1
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Do You Wish To Be Notified Via Email When The Backup Fails?", "Setup Email Notifications", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         frmEmail emailForm = new frmEmail();
         emailForm.Show();
     }
     else
     {
         SettingsWriter.WriteSettings();
         Application.Exit();
     }
 }
示例#2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (!testSuccessful)
            {
                DialogResult dialogResult = MessageBox.Show("Warning: The email test failed or hasn't been run. Are you sure you wish to continue to save these settings?", "Email Errors", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

                if (dialogResult == DialogResult.No)
                {
                    return;
                }
            }

            SettingsManager.NotifyOnFail = "true";
            SettingsManager.SmtpServer   = txtServer.Text;
            SettingsManager.SmtpUsername = txtUsername.Text;
            SettingsManager.SmtpPassword = txtPassword.Text;
            SettingsManager.SmtpPort     = txtPort.Text;
            SettingsManager.UseSsl       = chkUseSsl.Checked;
            SettingsManager.SendTo       = txtUsername.Text;

            SettingsWriter.WriteSettings();
            Application.Exit();
        }