Esempio n. 1
0
        public void CreateStudentUser(string username, string password, string email, string teacherName)
        {
            _userRepository.CreateStudentUser(username, email, password, teacherName);
            var guidstring = _userRepository.GetGuid(username);
            var request    = HttpContext.Current.Request;
            var appUrl     = HttpRuntime.AppDomainAppVirtualPath;

            if (appUrl != "/")
            {
                appUrl += "/";
            }
            var    baseUrl = string.Format("{0}://{1}{2}", request.Url.Scheme, request.Url.Authority, appUrl);
            string body    = "Click the link to confirm the mail:\n";

            MailHelper.SendMail(new List <string>()
            {
                email
            }, "*****@*****.**", "Confirmation mail", body + baseUrl + "Account/ConfirmRegistration?GUID=" + guidstring);
        }