CodeIgniter Forums
no $this->email->to generates error - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: no $this->email->to generates error (/showthread.php?tid=20489)



no $this->email->to generates error - El Forum - 07-11-2009

[eluser]xpix[/eluser]
Hi,

When using the mail class whithout providing a "to" only a "bcc" I get this error:


Code:
A PHP Error was encountered

Severity: Warning

Message: mail() expects parameter 1 to be string, array given

Filename: libraries/Email.php

Line Number: 1519

Here's the line:
Code:
if ( ! mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str, "-f ".$this->clean_email($this->_headers['From'])))

I'm guessing the error comes from the $this->_recipients which is empty or something.

I think that this should not happen for when not using the "to".

Any ideas how to fix this?


Thank You


no $this->email->to generates error - El Forum - 07-11-2009

[eluser]xpix[/eluser]
I guess this is a case where I need to use a loop to send emails.
Please ignore this post. Maybe an admin can delete it.

Thx