Jump to content

CakePHP email component problem


yahretzkee

Recommended Posts

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(copy@here.co.uk'); // mail to send a bcc copy

}else{ // if in test mode

$this->Email->to = array('sysadmin1@hotmail.co.uk',

'sysadmin2@gmail.com',

'sysadmin3@googlemail.com');

}

// 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 copy@here.hotmail.co.uk ? Maybe this problem is of another matter? Please help!

Link to comment
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.