fixed wrong ssl mode

This commit is contained in:
Mia Rose Winter 2024-02-08 00:50:08 +01:00
parent ac4bb12880
commit c1b05b28a5
Signed by: miawinter
GPG key ID: 4B6F6A83178F595E

View file

@ -45,7 +45,7 @@ public class SmtpEmailSender(IOptions<SmtpConfiguration> config, ILogger<SmtpEma
using var client = new SmtpClient();
await client.ConnectAsync(Configuration.Host, Configuration.Port,
Configuration.Ssl ? SecureSocketOptions.StartTls : SecureSocketOptions.None);
Configuration.Ssl ? SecureSocketOptions.SslOnConnect : SecureSocketOptions.None);
if (!string.IsNullOrWhiteSpace(Configuration.Username)) {
await client.AuthenticateAsync(Configuration.Username, Configuration.Password);
}