Hi
Im developing a custom registration module. I have successfully created the user, but im getting error when i try to send the email notification to the registered user. Im using the code something similar to the following.
UserInfo uUserInfo = newUserCreateStatus sStatus = new UserCreateStatus();
DotNetNuke.Entities.Users.
uUserInfo.Profile.InitialiseProfile(this.PortalId)
uUserInfo.PortalID = PortalId;
uUserInfo.Username = TxtUserName.Text;
uUserInfo.DisplayName = TxtUserName.Text;
uUserInfo.FirstName = TxtFirstName.Text;
uUserInfo.LastName = TxtLastName.Text;
uUserInfo.Email = TxtEmail.Text;
uUserInfo.Membership.Approved = true;
uUserInfo.Membership.Password = TxtPassword.Text;
uUserInfo.Profile.LastName = TxtLastName.Text;
uUserInfo.Profile.FirstName = TxtFirstName.Text;
sStatus =
UserController.CreateUser(ref uUserInfo); settings = DotNetNuke.Entities.Portals.PortalSettings.
DotNetNuke.Entities.Portals.PortalSettings
if (sStatus == UserCreateStatus.Success)
{
Mail.SendMail(uUserInfo, MessageType.UserRegistrationPublic, settings);
}
And this is the error from the logviewer.
DotNetNuke.Services.Exceptions.ModuleLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.Services.Localization.TokenReplace.calc(String strObjectName, String strPropertyName, String strFormat, ArrayList Custom, DataRow Row) at DotNetNuke.Services.Localization.TokenReplace.ReplaceEnvironmentTokens(String strSourceText, ArrayList Custom, DataRow Row) at DotNetNuke.Services.Localization.Localization.GetSystemMessage(String strLanguage, PortalSettings objPortal, String MessageName, UserInfo objUser, String ResourceFile, ArrayList Custom) at DotNetNuke.Services.Mail.Mail.SendMail(UserInfo user, MessageType msgType, PortalSettings settings)
What should i do. please help me.
Thanks in advance
DotNetNuke.Entities.Users.