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