Welcome Guest, Not a member yet? Register   Sign In
Email class problem: Multiple recipients
#1

[eluser]vaxis[/eluser]
Hi guys, I'm doing a newsletter system for my company and i have a problem with sending emails.
I send emails trough a foreach loop:

Code:
foreach($temp as $email) {
    $this->email->clear();
    $this->email->to($email);
    $this->email->from('[email protected]');
    $this->email->subject('Here is your info ');
    $this->email->message('Hi Here is the info you requested.');
    if( ! $this->email->send() ) {
        echo $this->email->print_debugger();
        exit();
    }
}
It send only first email in my array.

Someone had this problem? Thanks guys.
#2

[eluser]xzela[/eluser]
what is the structure of the $email var? It should be an array.

Also, make sure the email is being sent, else, based on this line: exit(); the foreach loop will stop if the email is not sent, which may be causing the issue.


Hope that helps.
#3

[eluser]vaxis[/eluser]
I solved the problem... I was working on my machine and email to my company was sent, but i forget that i were working in local and the problem was that... Now all working fine.
Thanks for help.




Theme © iAndrew 2016 - Forum software by © MyBB