Exemple #1
0
        // 如果我们已经发送了确认邮件,但是用户仍然没有收到
        // 邮件,我们可以允许他进行重发.
        protected void btnSendEmailAgain_Click(object sender, EventArgs e)
        {
            try
            {
                // 实例化一个EmailValidation类,准备再次发送确认邮件.
                EmailValidation validator = new EmailValidation(
                    tbSendMail.Text,
                    Session["password"].ToString(),
                    tbHost.Text,
                    chkUseSSL.Checked);

                // 使用ReSendValidationEmail方法再次发送确认邮件.
                validator.ReSendValidationEmail(tbValidateEmail.Text);
                lbMessage.Text = "邮件已经再次发送. 请再次查收.";
            }
            catch (Exception err)
            {
                lbMessage.Text = "错误:" + err.Message;
            }
        }
        // If we have send the confirmation Email, but the user still
        // not receive the Email, we could let him send again.
        protected void btnSendEmailAgain_Click(object sender, EventArgs e)
        {
            try
            {
                // Make an instance of the EmailValidation to be
                // ready for sending confirmation Email again.
                EmailValidation validator = new EmailValidation(
                    tbSendMail.Text,
                    Session["password"].ToString(),
                    tbHost.Text,
                    chkUseSSL.Checked);

                // Use ReSendValidationEmail method to re-send the
                // confirmation Email.
                validator.ReSendValidationEmail(tbValidateEmail.Text);
                lbMessage.Text = "Email has been re-sent. Please check it again.";
            }
            catch (Exception err)
            {
                lbMessage.Text = "Error:" + err.Message;
            }
        }