system/libraries/Email.php
/**
			* Prepares attachment string
			*
			* @param	string	$body		Message body to append to
			* @param	string	$boundary	Multipart boundary
			* @param	string	$multipart	When provided, only attachments of this type will be processed
			* @return	string
			*/
Prepares attachment string
@param        string  $body           Message body to append to
@param        string  $boundary       Multipart boundary
@param        string  $multipart      When provided, only attachments of this type will be processed
@return       string
Prepares attachment string @param string $body Message body to append to @param string $boundary Multipart boundary @param string $multipart When provided only attachments of this type will be processed @return string
protected function _append_attachments(&$body, $boundary, $multipart = null)
			{
				for ($i = 0, $c = count($this->_attachments); $i < $c; $i++)
				{
					if (isset($multipart) && $this->_attachments[$i]['multipart'] !== $multipart)
					{
						continue;
					}
					$name = isset($this->_attachments[$i]['name'][1])
					? $this->_attachments[$i]['name'][1]
					: basename($this->_attachments[$i]['name'][0]);
					$body .= '--'.$boundary.$this->newline
					.'Content-Type: '.$this->_attachments[$i]['type'].'; name="'.$name.'"'.$this->newline
					.'Content-Disposition: '.$this->_attachments[$i]['disposition'].';'.$this->newline
					.'Content-Transfer-Encoding: base64'.$this->newline
					.(empty($this->_attachments[$i]['cid']) ? '' : 'Content-ID: <'.$this->_attachments[$i]['cid'].'>'.$this->newline)
					.$this->newline
					.$this->_attachments[$i]['content'].$this->newline;
				}
				empty($name) OR $body .= '--'.$boundary.'--';
			}
protected function _append_attachments ( & $ body , $ boundary , $ multipart = null ) { for ( $ i = 0 , $ c = count ( $ this -> _attachments ) ; $ i < $ c ; $ i ++ ) { if ( isset ( $ multipart ) && $ this -> _attachments [ $ i ] [ 'multipart' ] !== $ multipart ) { continue ; } $ name = isset ( $ this -> _attachments [ $ i ] [ 'name' ] [ 1 ] ) ? $ this -> _attachments [ $ i ] [ 'name' ] [ 1 ] : basename ( $ this -> _attachments [ $ i ] [ 'name' ] [ 0 ] ) ; $ body .= '--' . $ boundary . $ this -> newline . 'Content-Type: ' . $ this -> _attachments [ $ i ] [ 'type' ] . '; name="' . $ name . '"' . $ this -> newline . 'Content-Disposition: ' . $ this -> _attachments [ $ i ] [ 'disposition' ] . ';' . $ this -> newline . 'Content-Transfer-Encoding: base64' . $ this -> newline . ( empty ( $ this -> _attachments [ $ i ] [ 'cid' ] ) ? '' : 'Content-ID: <' . $ this -> _attachments [ $ i ] [ 'cid' ] . '>' . $ this -> newline ) . $ this -> newline . $ this -> _attachments [ $ i ] [ 'content' ] . $ this -> newline ; } empty ( $ name ) OR $ body .= '--' . $ boundary . '--' ; }
Prepares attachment string
 @param        string  $body           Message body to append to
 @param        string  $boundary       Multipart boundary
 @param        string  $multipart      When provided, only attachments of this type will be processed
 @return       string
Prepares attachment string @param string $body Message body to append to @param string $boundary Multipart boundary @param string $multipart When provided only attachments of this type will be processed @return string
// $name won't be set if no attachments were appended, // and therefore a boundary wouldn't be necessary