示例#1
0
 public async Task <IActionResult> SendRegisterEmail(SendEmailModel model)
 {
     SendSmtp.Code      = new Random().Next(10000, 99999).ToString();
     SendSmtp.Recipient = model.RecipientEmail;
     SendSmtp.SendType  = model.SendType;
     if (!await SendSmtp.SendSmtpQQ())
     {
         return(new JsonResult(new APIResult <long> {
             ErrorMsg = "发送邮件失败,请稍后再试"
         })
         {
             StatusCode = 400
         });
     }
     return(new JsonResult(new APIResult <string> {
         Data = SendSmtp.Code
     }));
 }
示例#2
0
 public SendEmailController(IAppInfoService AppInfoSvc, SendSmtp SendSmtp)
 {
     this.AppInfoSvc = AppInfoSvc;
     this.SendSmtp   = SendSmtp;
 }