/** * Set the BCC and CC recipients to the email (they are the same for every email). * * @return Message */ public function setShadowRecipients() { //Cc recipients foreach ($this->email->getCc() as $emailAddress => $contact) { if ($contact instanceof Contact) { $this->message->addCc($contact->getEmail(), $contact); } else { $this->message->addCc($emailAddress, $contact); } } //Bcc recipients foreach ($this->email->getBcc() as $emailAddress => $contact) { if ($contact instanceof Contact) { $this->message->addBcc($contact->getEmail(), $contact); } else { $this->message->addBcc($emailAddress, $contact); } } if (!is_null($this->email->getReplyTo())) { $this->message->addReplyTo($this->email->getReplyTo(), $this->email->getReplyToName()); } }