original_string: public function addAttachment($file, $name = null, $type = null,
                                    $charset = 'us-ascii')
      {
          if (empty($name)) {
              $name = basename($file);
          }
  
          if (empty($type)) {
              $type = Horde_Mime_Magic::filenameToMime($file, false);
          }
  
          $num = $this->addPart($type, file_get_contents($file), $charset, 'attachment');
          $this->_parts[$num]->setName($name);
          return $num;
      }
code: public function addAttachment($file, $name = null, $type = null,
                                    $charset = 'us-ascii')
      {
          if (empty($name)) {
              $name = basename($file);
          }
  
          if (empty($type)) {
              $type = Horde_Mime_Magic::filenameToMime($file, false);
          }
  
          $num = $this->addPart($type, file_get_contents($file), $charset, 'attachment');
          $this->_parts[$num]->setName($name);
          return $num;
      }
code_tokens: public function addAttachment ( $ file , $ name = null , $ type = null , $ charset = 'us-ascii' ) { if ( empty ( $ name ) ) { $ name = basename ( $ file ) ; } if ( empty ( $ type ) ) { $ type = Horde_Mime_Magic :: filenameToMime ( $ file , false ) ; } $ num = $ this -> addPart ( $ type , file_get_contents ( $ file ) , $ charset , 'attachment' ) ; $ this -> _parts [ $ num ] -> setName ( $ name ) ; return $ num ; }
docstring: Adds an attachment.
  
  @param string $file     The path to the file.
  @param string $name     The file name to use for the attachment.
  @param string $type     The content type of the file.
  @param string $charset  The character set of the part (only relevant for
  text parts.
  
  @return integer  The part number.
docstring_tokens: Adds an attachment .