Пример #1
0
        public ActionResult Forgot()
        {//忘記密碼
            ForgotPwEmail emd = new ForgotPwEmail()
            {
                mail = "*****@*****.**",
                code = "ddd"
            };

            return(View("Email_forgot", emd));
        }
Пример #2
0
        /// <summary>
        /// 忘記密碼
        /// </summary>
        /// <param name="code">驗證代碼</param>
        /// <param name="email">對應mail</param>
        /// <returns></returns>
        public ResultInfo sendForgotPWMail(ForgotPwEmail md)
        {
            ResultInfo r = new ResultInfo();

            try
            {
                #region 信件發送
                string  Body = getMailBody("../Email/Email_forgot", md, newContext);//套用信件版面
                Boolean mail;

                #region 收信人及寄信人
                string        sendMail = openLogic().getReceiveMails()[0];
                List <string> r_mails  = new List <string>()
                {
                    md.mail
                };
                #endregion

                mail = Mail_Send(sendMail,                                                                      //寄信人
                                 r_mails.ToArray(),                                                             //收信人
                                 string.Format(Resources.Res.MailTitle_Forgot, Resources.Res.System_FrontName), //信件標題
                                 Body,                                                                          //信件內容
                                 true);                                                                         //是否為html格式
                if (mail == false)
                {                                                                                               //送信失敗
                    r.result  = false;
                    r.message = Resources.Res.Log_Err_SendMailFail;
                    return(r);
                }
                r.result = true;
                #endregion
            }
            catch (Exception ex)
            {
                r.result  = false;
                r.message = ex.Message;
            }
            return(r);
        }