Exemplo n.º 1
0
 public async Task Handle(ChangePwdEvent changeModel, CancellationToken cancellationToken)
 {
     await MailHelp.SendMailAsync(changeModel.Email,
                                  $"修改密码提示,来自蔡徐坤的提示",
                                  $"蔡徐坤温馨提醒,{changeModel.Name}密码已经成功修改,请牢记您的密码  时间是{DateTime.Now.ToString()} 修改密码的Ip是{changeModel.Ip}",
                                  "蔡家堡蔡徐坤");
 }
Exemplo n.º 2
0
 public async Task Handle(UserRegisterEvent registerEvent, CancellationToken cancellationToken)
 {
     await MailHelp.SendMailAsync(registerEvent.Email,
                                  $"欢迎{registerEvent.Name}注册服务,来自蔡徐坤的提示",
                                  $"蔡徐坤温馨提醒,{registerEvent.Name}注册成功,请牢记您的密码",
                                  "蔡家堡蔡徐坤");
 }
Exemplo n.º 3
0
        public async Task <IActionResult> SendMail([FromBody] SendMailModel request)
        {
            var hosts = HttpContext.Request.Host;

            _Apiloger.LogDebug($"{hosts.Host}正在请求发送邮件 端口是 {hosts.Port},{hosts.Value}");
            await MailHelp.SendMailAsync(request.Smtpserver, request.UserName, request.Pwd, request.ToMail, request.Subj, request.Bodys, request.FromMail);

            return(Ok(new SucessModel()));
        }