laatzen/LaaProductionWeb/LaaProduction.Web/Controllers/EmailController.cs
2023-06-19 15:43:55 +02:00

23 lines
620 B
C#

namespace LaaProduction.Web.Controllers
{
using LaaProduction.Web.Models.SMTP;
using System.Threading.Tasks;
using System.Web.Http;
using System.Web.Http.Results;
public class EmailController : ApiController
{
private readonly SMTPClient smtp;
public EmailController(SMTPClient smtp)
=> this.smtp = smtp;
public async Task<OkResult> Get()
{
await this.smtp.SendAsync("Test", "It works!!!", "stoyan.zlatev@xylem.com", new[] { "roland.drabesch@xylem.com", "stoyan.zlatev@xylem.com" });
return this.Ok();
}
}
}