private void SendEmailReport()
        {
            if (!Settings.EnableEmail)
            {
                return;
            }

            var i      = 0;
            var Report = "WARNING!!! A backup copy of the following elements has not been created" + Environment.NewLine;

            foreach (var row in from DataGridViewRow row in dataGridView1.Rows where row.Cells[0].Value != null where row.Cells[5].Value.ToString() == "Error" select row)
            {
                i++;
                Report += "Name: " + row.Cells[0].Value + " IP: " + row.Cells[1].Value + Environment.NewLine;
            }

            if (i <= 0)
            {
                return;
            }

            SendEmailReport ser = new SendEmailReport();

            ser.SendEmail(Report, EmailStatic.EmailServer, EmailStatic.EmailPort, EmailStatic.EmailUser, EmailStatic.EmailPassword, EmailStatic.EnableEmailSSL, EmailStatic.EmailAddress);
        }
        private void SendEmailReport()
        {
            if (!Settings.EnableEmail) return;

            var i = 0;
            var Report = "WARNING!!! A backup copy of the following elements has not been created" + Environment.NewLine;

            foreach (var row in from DataGridViewRow row in dataGridView1.Rows where row.Cells[0].Value != null where row.Cells[5].Value.ToString() == "Error" select row)
            {
                i++;
                Report += "Name: " + row.Cells[0].Value + " IP: " + row.Cells[1].Value + Environment.NewLine;
            }

            if (i <= 0) return;

            SendEmailReport ser = new SendEmailReport();
            ser.SendEmail(Report, EmailStatic.EmailServer, EmailStatic.EmailPort, EmailStatic.EmailUser, EmailStatic.EmailPassword, EmailStatic.EnableEmailSSL, EmailStatic.EmailAddress);
        }
 private void btn_SendTestEmail_Click(object sender, EventArgs e)
 {
     SendEmailReport ser = new SendEmailReport();
     ser.SendEmail("Test message", txb_Server.Text, txb_Port.Text, txb_User.Text, txb_Password.Text, chb_EnSSL.Checked, txb_Email.Text);
 }
Beispiel #4
0
        private void btn_SendTestEmail_Click(object sender, EventArgs e)
        {
            SendEmailReport ser = new SendEmailReport();

            ser.SendEmail("Test message", txb_Server.Text, txb_Port.Text, txb_User.Text, txb_Password.Text, chb_EnSSL.Checked, txb_Email.Text);
        }