Fix issue #1897
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index 08057f2..5b17edf 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -292,16 +292,7 @@
$this->set_header('To', implode(', ', $to));
}
- switch ($this->_get_protocol())
- {
- case 'smtp':
- $this->_recipients = $to;
- break;
- case 'sendmail':
- case 'mail':
- $this->_recipients = implode(', ', $to);
- break;
- }
+ $this->_recipients = $to;
return $this;
}
@@ -1408,6 +1399,11 @@
*/
protected function _send_with_mail()
{
+ if (is_array($this->_recipients))
+ {
+ $this->_recipients = implode(', ', $this->_recipients);
+ }
+
if ($this->_safe_mode === TRUE)
{
return mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str);