Site pages and AI tasks.
Gitea CI/CD / build (push) Successful in 1m40s

This commit is contained in:
Clive
2026-08-20 14:58:52 +10:00
parent 152a998311
commit e5d1446791
51 changed files with 2876 additions and 30 deletions
+39
View File
@@ -0,0 +1,39 @@
using System.Net.Mail;
using Microsoft.Extensions.Options;
namespace plushealthtech.Mail
{
/// <summary>
/// Sends outbound email through the configured SMTP server (MailPit in local
/// development). No authentication is used.
/// </summary>
public class MailSender
{
private readonly SmtpOptions _options;
private readonly ILogger<MailSender> _logger;
public MailSender(IOptions<SmtpOptions> options, ILogger<MailSender> logger)
{
_options = options.Value;
_logger = logger;
}
public async Task SendAsync(string subject, string body)
{
using var client = new SmtpClient(_options.Host, _options.Port)
{
EnableSsl = false
};
var message = new MailMessage(_options.From, _options.To)
{
Subject = subject,
Body = body,
IsBodyHtml = false
};
await client.SendMailAsync(message);
_logger.LogInformation("Mail sent to {To} (subject: {Subject})", _options.To, subject);
}
}
}