Exemplo n.º 1
0
        public static void SendActivateEmail(MembershipUser user)
        {
            Database db = DatabaseFactory.CreateDatabase("cnGrammit");

            //Create an activation DB record with a unique GUID that
            //Use that as a request variable to the activation page
            Guid activationGuid = Guid.NewGuid();

            DbCommand dbCommand = db.GetStoredProcCommand("usp_InsertUSER_ACTIVATION");
            db.AddInParameter(dbCommand, "@userID", DbType.Guid, user.ProviderUserKey);
            db.AddInParameter(dbCommand, "@GUID", DbType.Guid, activationGuid);
            db.AddOutParameter(dbCommand, "@ID", DbType.Int32, 2);
            db.ExecuteNonQuery(dbCommand);

            StringBuilder bodyMsg = new StringBuilder();

            bodyMsg.Append("So close... <br />  in order to complete enrollment with ScoreBored.net, you'll need to confirm your account.");
            bodyMsg.AppendFormat("<br />UserName: {0}", user.UserName);
            bodyMsg.Append("<br />Password Question: " + user.PasswordQuestion);

            bodyMsg.Append("<br />Click this link to activate your account: <a href=\"");
            bodyMsg.Append(HttpRuntime.Cache.Get("basePath").ToString());

            bodyMsg.Append("Login.aspx?a=" + HttpUtility.UrlEncode(activationGuid.ToString()) + "\">ACTIVATE</a>");

            MailGen mail = new MailGen();
            mail.SendMessage(user.Email, "*****@*****.**", "ScoreBored Account Activation", bodyMsg.ToString());
        }
Exemplo n.º 2
0
        public static void SendActivateEmail(MembershipUser user)
        {
            Database db = DatabaseFactory.CreateDatabase("cnGrammit");

            //Create an activation DB record with a unique GUID that
            //Use that as a request variable to the activation page
            Guid activationGuid = Guid.NewGuid();

            DbCommand dbCommand = db.GetStoredProcCommand("usp_InsertUSER_ACTIVATION");

            db.AddInParameter(dbCommand, "@userID", DbType.Guid, user.ProviderUserKey);
            db.AddInParameter(dbCommand, "@GUID", DbType.Guid, activationGuid);
            db.AddOutParameter(dbCommand, "@ID", DbType.Int32, 2);
            db.ExecuteNonQuery(dbCommand);


            StringBuilder bodyMsg = new StringBuilder();

            bodyMsg.Append("So close... <br />  in order to complete enrollment with ScoreBored.net, you'll need to confirm your account.");
            bodyMsg.AppendFormat("<br />UserName: {0}", user.UserName);
            bodyMsg.Append("<br />Password Question: " + user.PasswordQuestion);


            bodyMsg.Append("<br />Click this link to activate your account: <a href=\"");
            bodyMsg.Append(HttpRuntime.Cache.Get("basePath").ToString());

            bodyMsg.Append("Login.aspx?a=" + HttpUtility.UrlEncode(activationGuid.ToString()) + "\">ACTIVATE</a>");

            MailGen mail = new MailGen();

            mail.SendMessage(user.Email, "*****@*****.**", "ScoreBored Account Activation", bodyMsg.ToString());
        }
Exemplo n.º 3
0
        protected void btnUpDown_Click(object sender, EventArgs e)
        {
            //MembershipUser mUser = Membership.GetUser();
            //UserManager.SendActivateEmail(mUser);

            MailGen mail = new MailGen();
            mail.SendMessage("*****@*****.**", "*****@*****.**", "Score Bored Account Activation", "test MSg");

            this.btnAddComment.Text = "sent";
        }