src/Mail/Mail.php
private function formatHeaders() {

		$headers = [];
		$files 	 = true === isset($this -> headers['files']) ? $this -> headers['files'] : [];

		//Prepair emailaddresses
		foreach(['BCC', 'CC', 'Reply-To', 'From'] as $type) {

			if(true === isset($this -> headers[strtolower($type)])) {
				$headers[] = sprintf("%s: %s\r\n", $type, $this -> emailsToString($this -> headers[strtolower($type)]));
			}
		}

		//Notify
		if($notify = $this -> formatNotify()) {
			
			$headers[] = sprintf("Disposition-Notification-To: %s\r\n", $notify);
			$headers[] = sprintf("X-Confirm-Reading-To: %s\r\n", $notify);
		}

		//Priority
		if(true === isset($this -> headers['priority'])) {

			$headers[] = sprintf("X-Priority: %s\r\n", 			$this -> headers['priority'][0]);
			$headers[] = sprintf("X-MSMail-Priority: %s\r\n", 	$this -> headers['priority'][1]);
			$headers[] = sprintf("Importance: %s\r\n", 			$this -> headers['priority'][2]);
		}

		//Custom headers
		if(true === isset($this -> headers['custom'])) {

			foreach($this -> headers['custom'] as $key => $value) {
				$headers[] = sprintf("%s: %s\r\n", $key, $value);
			}
		}

		//Files
		if(count($files) > 0) {
			$headers[] = sprintf("Content-Type: multipart/mixed; boundary=\"Boundary-mixed-%s\"\r\n", $this -> getBoundary());
		}
		else {
			$headers[] = sprintf("Content-Type: multipart/alternative; boundary=\"Boundary-alt-%s\"\r\n\r\n", $this -> getBoundary());
		}

		return implode('', $headers);
	}
private function formatHeaders() {

		$headers = [];
		$files 	 = true === isset($this -> headers['files']) ? $this -> headers['files'] : [];

		//Prepair emailaddresses
		foreach(['BCC', 'CC', 'Reply-To', 'From'] as $type) {

			if(true === isset($this -> headers[strtolower($type)])) {
				$headers[] = sprintf("%s: %s\r\n", $type, $this -> emailsToString($this -> headers[strtolower($type)]));
			}
		}

		//Notify
		if($notify = $this -> formatNotify()) {
			
			$headers[] = sprintf("Disposition-Notification-To: %s\r\n", $notify);
			$headers[] = sprintf("X-Confirm-Reading-To: %s\r\n", $notify);
		}

		//Priority
		if(true === isset($this -> headers['priority'])) {

			$headers[] = sprintf("X-Priority: %s\r\n", 			$this -> headers['priority'][0]);
			$headers[] = sprintf("X-MSMail-Priority: %s\r\n", 	$this -> headers['priority'][1]);
			$headers[] = sprintf("Importance: %s\r\n", 			$this -> headers['priority'][2]);
		}

		//Custom headers
		if(true === isset($this -> headers['custom'])) {

			foreach($this -> headers['custom'] as $key => $value) {
				$headers[] = sprintf("%s: %s\r\n", $key, $value);
			}
		}

		//Files
		if(count($files) > 0) {
			$headers[] = sprintf("Content-Type: multipart/mixed; boundary=\"Boundary-mixed-%s\"\r\n", $this -> getBoundary());
		}
		else {
			$headers[] = sprintf("Content-Type: multipart/alternative; boundary=\"Boundary-alt-%s\"\r\n\r\n", $this -> getBoundary());
		}

		return implode('', $headers);
	}
private function formatHeaders ( ) { $ headers = [ ] ; $ files = true === isset ( $ this -> headers [ 'files' ] ) ? $ this -> headers [ 'files' ] : [ ] ; //Prepair emailaddresses
 foreach ( [ 'BCC' , 'CC' , 'Reply-To' , 'From' ] as $ type ) { if ( true === isset ( $ this -> headers [ strtolower ( $ type ) ] ) ) { $ headers [ ] = sprintf ( "%s: %s\r\n" , $ type , $ this -> emailsToString ( $ this -> headers [ strtolower ( $ type ) ] ) ) ; } } //Notify
 if ( $ notify = $ this -> formatNotify ( ) ) { $ headers [ ] = sprintf ( "Disposition-Notification-To: %s\r\n" , $ notify ) ; $ headers [ ] = sprintf ( "X-Confirm-Reading-To: %s\r\n" , $ notify ) ; } //Priority
 if ( true === isset ( $ this -> headers [ 'priority' ] ) ) { $ headers [ ] = sprintf ( "X-Priority: %s\r\n" , $ this -> headers [ 'priority' ] [ 0 ] ) ; $ headers [ ] = sprintf ( "X-MSMail-Priority: %s\r\n" , $ this -> headers [ 'priority' ] [ 1 ] ) ; $ headers [ ] = sprintf ( "Importance: %s\r\n" , $ this -> headers [ 'priority' ] [ 2 ] ) ; } //Custom headers
 if ( true === isset ( $ this -> headers [ 'custom' ] ) ) { foreach ( $ this -> headers [ 'custom' ] as $ key => $ value ) { $ headers [ ] = sprintf ( "%s: %s\r\n" , $ key , $ value ) ; } } //Files
 if ( count ( $ files ) > 0 ) { $ headers [ ] = sprintf ( "Content-Type: multipart/mixed; boundary=\"Boundary-mixed-%s\"\r\n" , $ this -> getBoundary ( ) ) ; } else { $ headers [ ] = sprintf ( "Content-Type: multipart/alternative; boundary=\"Boundary-alt-%s\"\r\n\r\n" , $ this -> getBoundary ( ) ) ; } return implode ( '' , $ headers ) ; }
Formats the headers and returns it as a string
@return string
Formats the headers and returns it as a string