diff --git a/MailSend/SendMailJob.cs b/MailSend/SendMailJob.cs index 5a5dbde..0ea15db 100644 --- a/MailSend/SendMailJob.cs +++ b/MailSend/SendMailJob.cs @@ -141,6 +141,26 @@ namespace MailSend.Service message.To.Add(MailboxAddress.Parse(sendMail.SendTo)); } + if (!string.IsNullOrEmpty(sendMail.CCTo)) + { + if (sendMail.CCTo.IndexOf(";") > -1) + { + var arrCCTo = sendMail.CCTo.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); + foreach (var s in arrCCTo) + { + var trimStr = s.Trim(); + if (!string.IsNullOrEmpty(trimStr)) + { + message.Cc.Add(MailboxAddress.Parse(trimStr)); + } + } + } + else + { + message.To.Add(MailboxAddress.Parse(sendMail.CCTo)); + } + } + message.Subject = sendMail.Title; var html = new TextPart("html") {