Hello.
I have set following default config in app/Config/email.php :
public $default = array(
'transport' => 'Mail',
'charset' => 'utf-8',
'headerCharset' => 'utf-8',
'layout' => 'default',
'emailFormat' => 'both',
);
Sending e-mails to one e-mail address (without cc and bcc) based on
this config works good.
But I want to send newsletters based on different layout, and to
several e-mail addresses given in "bcc" config.
E-mails does not deliver to addresses specified in $this->bcc config.
I also try to override default layout, but it keeps sending e-mail
with the default one.
Here is what I do to send e-mail in my newsletter controller:
App::uses('CakeEmail','Network/Email');
$default_email=Configure::read('default_email');
$email = new CakeEmail();
$email->config('default');
$email->from(array($default_email=>'Sitename'));
$email->sender(array($default_email=>'Sitename'));
$email->replyTo($default_email);
$email->layout = 'newsletter';
$email->template('newsletter');
$email->emailFormat='html';
$email->viewVars(array('data'=>$data));
$email->subject($data['Newsletter']['title']);
$email->to($default_email);
$email->bcc=$bcc;
$email->send();
What could be the problem?
I edited temporarily the send() function in lib/Cake/Network/Email/
CakeEmail.php and var_dump'ed "$this->bcc" and "$this->layout" and it
returned me the accurate values. But still, e-mail is not delivered to
bcc and the layout remains "default".
I pass an array like this to a "bcc":
array(1) {
[0]=>
string(X) "[email protected]"
}
Thank you very much for help!
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php