yahretzkee Posted September 9, 2011 Share Posted September 9, 2011 Hello, in my application there is a part of a code responsible of sending an emails to my users. It is a loop cycling through the whole database of users and just sending the email. Also when any email is sent, there is a copy sent to another email addres. The problem is that some of the users recieve other content in their email than it is in the copy. The commands are one under another, so I have no idea why this is happening: if ($TestMode == 'live') { // if not in test mode $this->Email->to = $User['User']['username']; //username - user's email address $this->Email->bcc = array([email protected]'); // mail to send a bcc copy }else{ // if in test mode $this->Email->to = array('[email protected]', '[email protected]', '[email protected]'); } // Send e-mail to user. $this->Email->subject = 'blahblah; $this->Email->template = 'my_template'; $this->Email->sendAs = 'html'; $this->Email->send(); $this->Email->reset(); The above code is a part of the loop. But the question is, why some users are getting another email than it is sent to [email protected] ? Maybe this problem is of another matter? Please help! Quote Link to comment https://forums.phpfreaks.com/topic/246802-cakephp-email-component-problem/ Share on other sites More sharing options...
jcombs_31 Posted September 19, 2011 Share Posted September 19, 2011 To should be formatted as a string and cc/bcc should be arrays as per the API. http://api.cakephp.org/class/email-component Quote Link to comment https://forums.phpfreaks.com/topic/246802-cakephp-email-component-problem/#findComment-1270827 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.