0
Я пробовал много вариантов пирога, чтобы включить cc
или bcc
или дополнительное электронное письмо со счетами и ничего не работает, мне нужен рабочий пример в следующем формате, я не нашел любое ясное решение.Адрес электронной почты CAKE, не принимающий множество опций bcc/cc
public function send() {
$id = $this->request->data['Invoice']['id'];
$invoiceNumber = $this->request->data['Invoice']['invoice_number'];
$to = $this->request->data['Invoice']['to'];
$from = $this->request->data['Invoice']['from'];
$message = $this->request->data['Invoice']['message'];
App::uses('CakeEmail', 'Network/Email');
$email = new CakeEmail();
$email->config(array(
'from' => $from,
'transport' => 'Mail',
'charset' => 'utf-8',
'headerCharset' => 'utf-8'
));
$result = $email->emailFormat('html')
->to($to)
->addbcc('[email protected]')
->from($from)
->returnPath($from)
->subject('New Invoice ('.$invoiceNumber.')')
->attachments(WWW_ROOT.'/temp/Invoice_'.$invoiceNumber.'.pdf')
->send($message);
unlink(WWW_ROOT.'/temp/Invoice_'.$invoiceNumber.'.pdf');
$this->Session->setFlash('Email Sent');
$this->redirect(array('controller'=>'invoices', 'action'=>'view', $id));
}