Skip to content

Commit

Permalink
Set default value for NetworkCredentials
Browse files Browse the repository at this point in the history
  • Loading branch information
adriangutowski committed Mar 21, 2021
1 parent c807b4e commit 26a2d4e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Serilog.Sinks.Email/Sinks/Email/EmailConnectionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,24 @@ public class EmailConnectionInfo
public const string DefaultSubject = "Log Email";

/// <summary>
/// Constructs the <see cref="EmailConnectionInfo"/> with the default port and default email subject set.
/// The default credentials used for authentication.
/// </summary>
static readonly NetworkCredential DefaultCredentials = CredentialCache.DefaultNetworkCredentials;

/// <summary>
/// Constructs the <see cref="EmailConnectionInfo"/> with the default credentials, default port and default email subject set.
/// </summary>
public EmailConnectionInfo()
{
Port = DefaultPort;
EmailSubject = DefaultSubject;
IsBodyHtml = false;
NetworkCredentials = new NetworkCredential();
NetworkCredentials = DefaultCredentials;
}

/// <summary>
/// Gets or sets the credentials used for authentication.
/// Default value is <see cref="CredentialCache.DefaultNetworkCredentials"/>.
/// </summary>
public ICredentialsByHost NetworkCredentials { get; set; }

Expand Down

0 comments on commit 26a2d4e

Please sign in to comment.