コード例 #1
0
        private void btnSend_Click(object sender, EventArgs e)
        {
            if (Config.Settings.SMTPFromAddress.Length == 0 || Config.Settings.SMTPServer.Length == 0)
            {
                if (MessageBox.Show("You have not properly set up SMTP settings yet, please do so now before " +
                    "sending feedback.", "SMTP Not Configured", MessageBoxButtons.OKCancel, MessageBoxIcon.Error,
                    MessageBoxDefaultButton.Button1) == DialogResult.Cancel) return;
                FrmSettings dialog = new FrmSettings();
                dialog.ShowDialog();
                dialog.Close();
                if (Config.Settings.SMTPFromAddress.Length == 0 || Config.Settings.SMTPServer.Length == 0)
                    return;
            }

            if (MessageBox.Show("Are you sure you're ready to send this message?", "Confirmation",
                MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1) == DialogResult.No)
                return;

            string subject = Prefix + (txtSubject.Text.Trim().Length > 0 ? txtSubject.Text.Trim() :
                "General Feedback");
            if(SMTPFunctions.SendMessage(Recipient, subject, txtMessage.Text))            
                this.DialogResult = DialogResult.OK;
        }
コード例 #2
0
 private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     var dialog = new FrmSettings();
     dialog.ShowDialog();
     dialog.Close();
 }