Smtp client has the following:
SmtpClient client = new SmtpClient(server);
client.UseDefaultCredentials = true;
using these credentials I can send emails.
Now when trying to hook Serilog email sink there is no such option, it wants actual username&password:
new EmailConnectionInfo
{
FromEmail = "",
ToEmail = "",
MailServer = "",
//I want default credentials, not this
NetworkCredentials = new NetworkCredential
{
UserName = "",
Password = ""
},
EnableSsl = false,
ServerCertificateValidationCallback = (senderX, certificate, chain, sslPolicyErrors) => true,
Port = 587,
EmailSubject = ""
}
Is there a way to make it accept default credentials?