Skip to content

Commit 350f7af

Browse files
authored
MailTarget - Validate Email Address on InitializeTarget (#243)
1 parent 457f5c5 commit 350f7af

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/NLog.MailKit/MailTarget.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,14 +701,14 @@ private bool AddAddresses(InternetAddressList mailAddressCollection, Layout? lay
701701
try
702702
{
703703
mailAddressCollection.Add(MailboxAddress.Parse(mail));
704+
added = true;
704705
}
705706
catch (Exception ex)
706707
{
707708
InternalLogger.Error(ex, "{0}: Invalid email address: {1}", this, mailAddress);
708709
if (allowThrow || LogManager.ThrowExceptions)
709710
throw;
710711
}
711-
added = true;
712712
}
713713
}
714714

0 commit comments

Comments
 (0)