components/PhpMailer.php
function AddAttachment($path, $name = "", $encoding = "base64", $type = "application/octet-stream") {
      if(!@is_file($path))
      {
         $this->error_handler(sprintf("Could not find %s file on filesystem", $path));
         return false;
      }

      $filename = basename($path);
      if($name == "")
         $name = $filename;

      // Append to $attachment array
      $cur = count($this->attachment);
      $this->attachment[$cur][0] = $path;
      $this->attachment[$cur][1] = $filename;
      $this->attachment[$cur][2] = $name;
      $this->attachment[$cur][3] = $encoding;
      $this->attachment[$cur][4] = $type;
      $this->attachment[$cur][5] = false; // isStringAttachment

      return true;
   }
function AddAttachment($path, $name = "", $encoding = "base64", $type = "application/octet-stream") {
      if(!@is_file($path))
      {
         $this->error_handler(sprintf("Could not find %s file on filesystem", $path));
         return false;
      }

      $filename = basename($path);
      if($name == "")
         $name = $filename;

      // Append to $attachment array
      $cur = count($this->attachment);
      $this->attachment[$cur][0] = $path;
      $this->attachment[$cur][1] = $filename;
      $this->attachment[$cur][2] = $name;
      $this->attachment[$cur][3] = $encoding;
      $this->attachment[$cur][4] = $type;
      $this->attachment[$cur][5] = false; // isStringAttachment

      return true;
   }
function AddAttachment ( $ path , $ name = "" , $ encoding = "base64" , $ type = "application/octet-stream" ) { if ( ! @ is_file ( $ path ) ) { $ this -> error_handler ( sprintf ( "Could not find %s file on filesystem" , $ path ) ) ; return false ; } $ filename = basename ( $ path ) ; if ( $ name == "" ) $ name = $ filename ; // Append to $attachment array $ cur = count ( $ this -> attachment ) ; $ this -> attachment [ $ cur ] [ 0 ] = $ path ; $ this -> attachment [ $ cur ] [ 1 ] = $ filename ; $ this -> attachment [ $ cur ] [ 2 ] = $ name ; $ this -> attachment [ $ cur ] [ 3 ] = $ encoding ; $ this -> attachment [ $ cur ] [ 4 ] = $ type ; $ this -> attachment [ $ cur ] [ 5 ] = false ; // isStringAttachment return true ; }
Adds an attachment from the OS filesystem.
Checks if attachment is valid and then adds
the attachment to the list.
Returns false if the file was not found.
@public
@returns bool
Adds an attachment from the OS filesystem . Checks if attachment is valid and then adds the attachment to the list . Returns false if the file was not found .