Beispiel #1
0
        private void LblSendmail_Click(object sender, EventArgs e)
        {
            inputForm = new InputForm("Enter an Email");
            string mailBody = "";

            if (inputForm.Start())
            {
                try
                {
                    counter = 0;
                    foreach (string line in File.ReadAllLines(this.fileName).Reverse <string>())
                    {
                        int foo;
                        int.TryParse(line.Split(',')[1], out foo);
                        if (foo <= 1)
                        {
                            break;
                        }
                        mailBody += (++counter).ToString() + ")" + line.Replace(",", "........") + "<br>";
                    }
                }
                catch
                {
                }
                switch (Player.SendEmail(mailBody))
                {
                case 1:
                    break;

                case 2:
                    if (Player.MailTo != null)
                    {
                        MessageBox.Show("Invalid Email address!\nCall the SWAT Team! ");
                    }
                    this.LblSendmail_Click(sender, e);
                    break;

                case 3:
                    if (Player.MailTo != null)
                    {
                        MessageBox.Show("Sorry, network problem!\nCall the SWAT Team!");
                    }
                    break;
                }
                Player.MailTo = "";
            }
        }