예제 #1
0
        public async Task SendMessage(MessagePayLoad payload)
        {
            string data = JsonConvert.SerializeObject(payload);

            Message message = new Message(Encoding.UTF8.GetBytes(data));

            await _queueClient.SendAsync(message);
        }
예제 #2
0
        private async Task SendMessage(MessagePayLoad message)
        {
            HttpClient client      = new HttpClient();
            string     messageJson = JsonSerializer.Serialize(message);

            string token = await GetToken();

            client.DefaultRequestHeaders.Authorization = AuthenticationHeaderValue.Parse(token);

            client.PostAsync("https://localhost:5002/api/email",
                             new StringContent(messageJson, Encoding.UTF8, "application/json"));
        }
예제 #3
0
        public void SendNewUserEmail(MessagePayLoad message)
        {
            string messageFrom = "*****@*****.**";

            var smtpClient = new SmtpClient("smtp.gmail.com")
            {
                Port        = 587,
                Credentials = new NetworkCredential(messageFrom, "@nt@lis12"),
                EnableSsl   = true,
            };

            smtpClient.Send(messageFrom, message.Recipents, message.Subject, message.Body);
        }
예제 #4
0
 private Task QueueMessage(MessagePayLoad message)
 {
     return(_sender.SendMessage(message));
 }
예제 #5
0
        public void Send(MessagePayLoad message)
        {
            EmailSender emailSender = new EmailSender();

            emailSender.SendNewUserEmail(message);
        }