public function setRecipients($email)
    {
        if (!is_array($email)) {
            $email = explode(',', $email);
            // trim all values
            array_walk($email, function(&$val) {
                return $val = trim($val);
            });
            // remove empty elements
            $email = array_filter($email);
        }

        foreach ($email as $e) {
            if (!$this->validateHeaderFieldValue($e)) {
                throw new EmailValidationException(__('Recipient address can not contain carriage return or newlines.'));
            }
        }

        $this->_recipients = $email;
    }
public function setRecipients($email)
    {
        if (!is_array($email)) {
            $email = explode(',', $email);
            // trim all values
            array_walk($email, function(&$val) {
                return $val = trim($val);
            });
            // remove empty elements
            $email = array_filter($email);
        }

        foreach ($email as $e) {
            if (!$this->validateHeaderFieldValue($e)) {
                throw new EmailValidationException(__('Recipient address can not contain carriage return or newlines.'));
            }
        }

        $this->_recipients = $email;
    }
public function setRecipients ( $ email ) { if ( ! is_array ( $ email ) ) { $ email = explode ( ',' , $ email ) ; // trim all values array_walk ( $ email , function ( & $ val ) { return $ val = trim ( $ val ) ; } ) ; // remove empty elements $ email = array_filter ( $ email ) ; } foreach ( $ email as $ e ) { if ( ! $ this -> validateHeaderFieldValue ( $ e ) ) { throw new EmailValidationException ( __ ( 'Recipient address can not contain carriage return or newlines.' ) ) ; } } $ this -> _recipients = $ email ; }
Sets the recipients.

@param string|array $email
The email-address(es) to send the email to.
@throws EmailValidationException
@return void
Sets the recipients .