Skip to content

Commit 78fee64

Browse files
authored
PickupDirectoryLocation - SmtpServer is no longer RequiredParameter (#179)
1 parent 8a25f6b commit 78fee64

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/NLog.MailKit/MailTarget.cs

+6-2
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ public Layout Body
177177
/// Gets or sets SMTP Server to be used for sending.
178178
/// </summary>
179179
/// <docgen category='SMTP Options' order='10' />
180-
[RequiredParameter]
181180
public Layout SmtpServer { get; set; }
182181

183182
/// <summary>
@@ -467,7 +466,12 @@ private void CheckRequiredParameters()
467466
var smtpAuthentication = RenderLogEvent(SmtpAuthentication, LogEventInfo.CreateNullEvent());
468467
if (smtpAuthentication == SmtpAuthenticationMode.Ntlm)
469468
{
470-
throw new NLogConfigurationException("NTLM not yet supported");
469+
throw new NLogConfigurationException("SmtpAuthentication NTLM not yet supported");
470+
}
471+
472+
if (PickupDirectoryLocation is null && SmtpServer is null)
473+
{
474+
throw new NLogConfigurationException("SmtpServer is required");
471475
}
472476
}
473477

0 commit comments

Comments
 (0)