laatzen/LaaProductionWeb/LaaProductionWeb.API/Controllers/EmailController.cs
2023-05-17 15:54:15 +02:00

23 lines
653 B
C#

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<IActionResult> Get()
{
await this.smtp.SendAsync("Test", "It works!!!", "stoyan.zlatev@xylem.com", new[] { "roland.drabesch@xylem.com", "stoyan.zlatev@xylem.com" });
return this.Ok();
}
}
}