namespace LaaProductionWeb.API.Controllers { using LaaProductionWeb.API.Models.SMTP; using Microsoft.AspNetCore.Mvc; using System.Threading.Tasks; [ApiController] [Route("[controller]")] public class EmailController : ControllerBase { private readonly SMTPClient smtp; public EmailController(SMTPClient smtp) => this.smtp = smtp; public async Task Get() { await this.smtp.SendAsync("Test", "It works!!!", "stoyan.zlatev@xylem.com", new[] { "roland.drabesch@xylem.com", "stoyan.zlatev@xylem.com" }); return this.Ok(); } } }