CakePHP cannot get multiple emails send after a previous execution..
this is an example:
$Email = new CakeEmail('smtp');
$Email->emailFormat('html')
->template('myTemplate')
->to('someEmail@email.com')
->subject('someSubject')
->send('MyMessage');
unset($Email);
re-Instance cakeEmail
$arrEmails = array('email1@email.com','email2@email.com','email3@email.com','email4@email.com','email5@email.com');
$Email = new CakeEmail('smtp');
$Email->emailFormat('html')
->template('mySecondTemplate')
->to($arrEmails)
->subject('OtherSubject')
->send('MyOtherMessage');
I’ve also tried to create 2 different instances of cakeEmail but the same occur.
Else I’ve tried is to put in a loop “for” but nothing happens.
If anyone has an idea of what is happening here I would be very helpful and I appreciate it.
Thank you.
Take a look at the
reset()method:http://api20.cakephp.org/class/cake-email#method-CakeEmailreset