EmailMessage extension small fix

master^2
Tudor Stanciu 2023-01-29 02:06:18 +02:00
parent e4130c29ba
commit 17ec8b95d4
1 changed files with 2 additions and 2 deletions

View File

@ -11,9 +11,9 @@ namespace Correo.Abstractions.Extensions
public static string Log(this EmailMessage message)
{
var msg = $"Email sent: Subject: {message.Subject}; From: {message.From.Address}; To: {message.To.Log()};";
if (message.Cc != null)
if (message.Cc != null && message.Cc.Any())
msg += $" Cc: {message.Cc.Log()};";
if (message.Bcc != null)
if (message.Bcc != null && message.Bcc.Any())
msg += $" Bcc: {message.Bcc.Log()};";
return msg;
}