protected void btnSubmit_Click(object sender, EventArgs e)
        {
            string email    = txtEmail.Text;
            string password = txtPassword.Text;
            int    abc      = ddlEmailProvider.SelectedIndex;

            if (Session["tempEmail"] != null)
            {
                EmailClass emailClass = (EmailClass)Session["tempEmail"];

                try
                {
                    EmailCredential emailCredential = new EmailCredential(new NetworkCredential(email, password), EmailClass.getStmpClient(ddlEmailProvider.SelectedValue));
                    emailClass.sendEmail(emailCredential);
                    EmailClass.generateCredential(email, password, EmailClass.getStmpClient(ddlEmailProvider.SelectedValue));

                    string url = Request.QueryString["ReturnUrl"];
                    Response.Write(" <script language = 'javascript'> window.alert('Email has been sent. Redirecting previous page.'); window.location = '" + url + "';</script>");
                }
                catch (SmtpFailedRecipientsException stmpRecipientsException)
                {
                    lblError.Text = "Email failed to send to " + stmpRecipientsException.FailedRecipient;
                }
                catch (SmtpException smtpException)
                {
                    lblError.Text = "The email or password might typed wrong or " + smtpException.Message;
                }
            }
            else
            {
                lblError.Text = "There is no email to be send, credential is not created.";
            }
        }