src/Mailer/Email.php
public function addAttachment($file, $name = null, $fileInfo = []) {
		$fileInfo['file'] = $file;
		if (!empty($name)) {
			$fileInfo = [$name => $fileInfo];
		} else {
			$fileInfo = [$fileInfo];
		}
		return $this->addAttachments($fileInfo);
	}
public function addAttachment($file, $name = null, $fileInfo = []) {
		$fileInfo['file'] = $file;
		if (!empty($name)) {
			$fileInfo = [$name => $fileInfo];
		} else {
			$fileInfo = [$fileInfo];
		}
		return $this->addAttachments($fileInfo);
	}
public function addAttachment ( $ file , $ name = null , $ fileInfo = [ ] ) { $ fileInfo [ 'file' ] = $ file ; if ( ! empty ( $ name ) ) { $ fileInfo = [ $ name => $ fileInfo ] ; } else { $ fileInfo = [ $ fileInfo ] ; } return $ this -> addAttachments ( $ fileInfo ) ; }
Add an attachment from file

@param string $file Absolute path
@param string|null $name
@param array $fileInfo
@return $this
Add an attachment from file