23 lines
653 B
C#
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();
|
|
}
|
|
}
|
|
} |