PhpMimeMailParser\Parser::setPath PHP Метод

setPath() публичный Метод

Set the file path we use to get the email text
public setPath ( string $path ) : Parser
$path string File path to the MIME mail
Результат Parser MimeMailParser Instance
    public function setPath($path)
    {
        // should parse message incrementally from file
        $this->resource = mailparse_msg_parse_file($path);
        $this->stream = fopen($path, 'r');
        $this->parse();
        return $this;
    }

Usage Example

Пример #1
0
 /**
  * Parse the given email resource
  *
  * @param  string $file path/to/file
  * @return Parser
  */
 public function parseFile($file)
 {
     if (!file_exists($file)) {
         throw new Exception("File {$file} does not exist.");
     }
     $this->lines = file($file);
     $this->parser->setPath($file);
     $bounceReason = $this->findBounceReason();
     fputcsv($this->csv, array($this->findRecipient(), key($bounceReason), current($bounceReason)), $this->csvDelimiter, $this->csvEnclosure);
     return $this;
 }
All Usage Examples Of PhpMimeMailParser\Parser::setPath