fix: pass cert validation check

This commit is contained in:
Oliver Booth 2024-10-23 22:19:01 +01:00
parent 0b1037819a
commit 43bcc87ad0
Signed by: oliverbooth
GPG Key ID: 2A862C3F46178E8E

View File

@ -95,6 +95,7 @@ public class ContactController : Controller
destination = mailSection.GetSection("Destination").Value ?? string.Empty; destination = mailSection.GetSection("Destination").Value ?? string.Empty;
var client = new SmtpClient(); var client = new SmtpClient();
client.ServerCertificateValidationCallback = (s, c, h, e) => true;
client.Connect(mailServer, port, SecureSocketOptions.SslOnConnect); client.Connect(mailServer, port, SecureSocketOptions.SslOnConnect);
client.Authenticate(mailUsername, mailPassword); client.Authenticate(mailUsername, mailPassword);
return client; return client;