public async Task <ResultDto> CreateEmailHistoryInfo(createEmailHistoryInfoDto createEmailHistoryInfoDto, bool?isSendEmail = true)
        {
            // 检测邮箱账号为否为QQ邮箱,并且是否正确
            string expression = AppConfigurtaionService.Configuration["EmailServicesStrings:EmailExpression"];

            if (!Regex.IsMatch(createEmailHistoryInfoDto.RecipientId, expression, RegexOptions.Compiled))
            {
                // 请输入正确的QQ邮箱账号
                throw new Exception("Please enter the correct QQ email account.");
            }
            EmailHistoryInfo emailHistory = new EmailHistoryInfo()
            {
                RecipientId = createEmailHistoryInfoDto.RecipientId,
                EmailBody   = createEmailHistoryInfoDto.EmailBody
            };

            // 发送QQ邮件
            if (isSendEmail.Value)
            {
                emailHistory.EmailBody = _emailServices.SendRandomCode(emailHistory.RecipientId);
            }
            await _context.EmailHistoryInfo.AddAsync(emailHistory);

            return(new ResultDto()
            {
                Success = await _context.SaveChangesAsync() > 0 ? true : false
            });
        }