Stable email sender

This commit is contained in:
Khwezi Mngoma
2026-05-04 23:29:29 +02:00
parent 604d21162a
commit 33112dcf79
6 changed files with 9 additions and 9 deletions
@@ -16,7 +16,7 @@ public class SendEmailCommandHandler(IOptions<SmtpSettings> smtpOptions) : IRequ
if(settings.Credentials == null)
return Result.Fail(new Error("SMTP credentials are not configured."));
if(string.IsNullOrWhiteSpace(settings.Credentials.Username) || string.IsNullOrWhiteSpace(settings.Credentials.Password))
if(string.IsNullOrWhiteSpace(settings?.Credentials.Username) || string.IsNullOrWhiteSpace(settings.Credentials.Password))
return Result.Fail(new Error("SMTP credentials are incomplete."));
if(string.IsNullOrWhiteSpace(settings.Host) || settings.Port == 0)