|
|
@@ -1531,8 +1531,8 @@ namespace System.Web.UI.WebControls
|
|
|
UserName, Password, Email, Question, Answer, !DisableCreatedUser, null, out status);
|
|
|
|
|
|
if ((newUser != null) && (status == MembershipCreateStatus.Success)) {
|
|
|
- OnCreatedUser (new EventArgs ());
|
|
|
- SendPasswordByMail(UserName, Password);
|
|
|
+ OnCreatedUser (new EventArgs ());
|
|
|
+ SendPasswordByMail (newUser, Password);
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
@@ -1574,18 +1574,20 @@ namespace System.Web.UI.WebControls
|
|
|
OnCreateUserError (new CreateUserErrorEventArgs (status));
|
|
|
|
|
|
return false;
|
|
|
- }
|
|
|
-
|
|
|
- private void SendPasswordByMail (string username, string password)
|
|
|
- {
|
|
|
- MembershipUser user = MembershipProviderInternal.GetUser (UserName, false);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void SendPasswordByMail (MembershipUser user, string password)
|
|
|
+ {
|
|
|
if (user == null)
|
|
|
return;
|
|
|
+
|
|
|
+ if (_mailDefinition == null)
|
|
|
+ return;
|
|
|
|
|
|
string messageText = "A new account has been created for you. Please go to the site and log in using the following information.\nUser Name: <%USERNAME%>\nPassword: <%PASSWORD%>";
|
|
|
|
|
|
- ListDictionary dictionary = new ListDictionary ();
|
|
|
- dictionary.Add ("<%USERNAME%>", username);
|
|
|
+ ListDictionary dictionary = new ListDictionary ();
|
|
|
+ dictionary.Add ("<%USERNAME%>", user.UserName);
|
|
|
dictionary.Add ("<%PASSWORD%>", password);
|
|
|
|
|
|
MailMessage message = null;
|