Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize NetworkCredentials in EmailConnectionInfo #91

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/Serilog.Sinks.Email/Sinks/Email/EmailConnectionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +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 = 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