public function setFileToSend($file, $attachmentName = null) { if ($attachmentName === null) { $attachmentName = basename($file); } $this->_file = $file; $this->setAttachment($attachmentName); return $this; }