serilog-sinks-email icon indicating copy to clipboard operation
serilog-sinks-email copied to clipboard

documentation on how to configure credentials from the appsettings.json file

Open doreille opened this issue 1 year ago • 4 comments

The configuration parameters have changed in version 3.0. Prior to version 3.0, SMTP credentials were configured using the userName and password attributes. From version 3.0 onwards, the SMTP credentials are configured using the credentials attribute which has the ICredentialsByHost interface type.

I haven't found any documentation or examples of how to set this. I try

"credentials": { "type": "System.Net.NetworkCredential, System.Net.Primitives", "UserName": "#########", "Password": "#########" }

but this return the error System.InvalidOperationException: 'Cannot create instance of type 'System.Net.ICredentialsByHost' because it is either abstract or an interface.'

doreille avatar Jul 19 '24 13:07 doreille