CakePhp Cron Mailer - Howto BCC

时间:2012-11-20 09:13:55

标签: cakephp

我搜索过高低。我不是很技术,真的很挣扎。 Cron邮件程序,没有关于CC和BCC的详细信息。我尝试过各种代码来将硬编码的BCC添加到外发电子邮件中。有人提出了一个数组,无法让它工作。我相信这很简单,但任何帮助都将不胜感激。我无法前进的路线被注释掉了。

CODE


        $this->EmailQueue->to = $booking['Guest']['email'];

        //$this->EmailQueue->bcc = 'james@domain.com';

            $this->EmailQueue->from = $email;
            $this->EmailQueue->headers = array(
                'booking_token' => $booking['Booking']['token'],
            );
            $this->EmailQueue->additionalParams = '-f ' . $bounce_options['bounce_email'];
            $this->EmailQueue->return = $bounce_options['bounce_email'];
            $this->EmailQueue->subject = $template['EmailTemplate']['subject'];
            $this->EmailQueue->template = 'mailman_invitation';
            $this->EmailQueue->sendAs = 'both';
            $this->EmailQueue->delivery = 'db';
            $this->set('body', $template['EmailTemplate']['html']);

1 个答案:

答案 0 :(得分:0)

将BCC包含在EmailQueue变量的headers变量中。

您必须将代码修改为

$this->EmailQueue->headers = array(
                'booking_token' => $booking['Booking']['token'],
                'bcc' => 'email@tobebcced.com'
            );