public async Task <WebServiceResult <SendMailResponseDTO> > ProcessAuthEmail(SendMailRequestDTO sendMailRequestDTO) { UTF8Encoding encoder = new UTF8Encoding(); byte[] data = encoder.GetBytes(JsonConvert.SerializeObject(sendMailRequestDTO)); string utfString = Encoding.UTF8.GetString(data, 0, data.Length); var result = await webService.PostAsync <SendMailResponseDTO>("Email/ProcessAuthEmail", utfString); return(result); }
public void SendEmail(SendMailRequestDTO requestDTO) { MailMessage message = new MailMessage() { From = new MailAddress(this._smtpClientProvider.config.Value.from), Subject = requestDTO.title, Body = requestDTO.content }; requestDTO.recipients.ForEach(r => message.To.Add(r)); this._smtpClientProvider.smtpClient.Send(message); }
public ActionResult HandleSendEmail(SendMailRequestDTO requestDTO) { this._mailService.SendEmail(requestDTO); return(NoContent()); }