Exemplo n.º 1
0
        public static void SendFindPwdEmail(Guid appID, string userName, string recipient, Guid authCode)
        {
            string        url    = WebHostUrl + "Resources/Email/FindPwd.htm";
            var           client = new HttpClient(new Uri(url));
            StringBuilder body   = new StringBuilder(client.GetResponse().GetResponseText());

            //TODO:替换变量
            body.Replace("{$UserName$}", userName);
            body.Replace("{$SiteUrl$}", WebHostUrl);
            body.Replace("{$FindUrl$}", WebHostUrl + "Account/ChangePwd.aspx?authCode=" + authCode.ToString());
            var svc = new InfrastructureRepository();

            svc.SendEmail(new SendEmailParameter()
            {
                AppID      = appID,
                Recipients = new string[] { recipient },
                Subject    = "找回密码帐户,请查收.",
                Body       = body.ToString()
            });
        }
Exemplo n.º 2
0
        public void SendEmail(SendEmailParameter param)
        {
            var repository = new InfrastructureRepository();

            repository.SendEmail(param);
        }