public async Task SendMailAsync(MailMessageDto mailMessageDto) { MailMessage mailMessage = mailMessageDto.GetMailMessage(); mailMessage.From = new MailAddress(_smtpConfigDto.User); using var client = CreateSmtpClient(); await client.SendMailAsync(mailMessage); }
public async Task SendMail(MailMessageDto mailMessageDto) { using var client = CreateSmtpClient(); mailMessageDto.From = _smtpConfigDto.User; MailMessage mailMessage = mailMessageDto.GetMailMessage(); mailMessage.IsBodyHtml = true; await client.SendMailAsync(mailMessage); }
public async Task SendUserRegisterMailAsync(int userId) { using var client = CreateSmtpClient(); var userInfo = _userService.GetByUserId(userId); MailMessageDto mailMessageDto = new MailMessageDto { Body = "Kayıt işleminizi tamamlamak için " + "<a href='https://aktiflinkadresi/Account/UserRegisterCheck?reqUrl=*" + userInfo.UserGuid.ToString() + "'>linke</a> tıklayınız.", To = userInfo.Email, Subject = "Kullanıcı Register Islemi Kontrol", From = _smtpConfigDto.User }; MailMessage mailMessage = mailMessageDto.GetMailMessage(); mailMessage.IsBodyHtml = true; await client.SendMailAsync(mailMessage); }