Exemplo n.º 1
0
        public async Task <JsonResult> Send(string toEmail, string Subject, string Body)
        {
            string username = HttpContext.User.Identity.Name;

            if (!(admins.Contains(username)))
            {
                return(Json(new {
                    status = "Forbidden"
                }));
            }

            await _emailSender.SendEmailConfirmationAsync("*****@*****.**", "https://www.foxdeploy.com");

            var response = await _emailSender.EasySendEmailWait(toEmail, Subject, Body);

            string key = _emailSender.CheckKey();

            //await _emailSender.SendEmailAsync("*****@*****.**", "GoT-NewUser: "******"*****@*****.**",
                toEmail = toEmail,
                Subject = Subject,
                Body = Body,
                Status = response.StatusCode.ToString(),
                Key = key
            }
                        ));
        }