public Task SendEmailAsync <T>(string email, string subject, string viewNameOrPath, T model)
 {
     return(_webMailService.SendEmailAsync(
                _smtpConfig.Value.Smtp,
                new[] { new MailAddress {
                            ToName = "", ToAddress = email
                        } },
                subject,
                viewNameOrPath,
                model
                ));
 }
        public async Task <IActionResult> SendEmail()
        {
            await _webMailService.SendEmailAsync(
                smtpConfig : _smtpConfig.Value,
                emails : new List <MailAddress>
            {
                new MailAddress {
                    ToName = "User 1", ToAddress = "*****@*****.**"
                },
                // ...
            },
                subject : "Hello!",
                message : "Hello!<br/> This is an email from us!");

            return(RedirectToAction(nameof(Index)));
        }