Guest User

Untitled

a guest
Feb 20th, 2018
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. Fatal error: Uncaught Error: Call to undefined function PhpMimeMailParsermailparse_msg_parse_file() in /home/mysite/public_html/vendor/php-mime-mail-parser/php-mime-mail-parser/src/Parser.php:106 Stack trace: #0 /home/mysite/public_html/email-to-database.php(13): PhpMimeMailParserParser->setPath('path/to/mail.tx...') #1 {main} thrown in /home/mysite/public_html/vendor/php-mime-mail-parser/php-mime-mail-parser/src/Parser.php on line 106
  2.  
  3. require_once('vendor/autoload.php');
  4.  
  5. $path = 'path/to/mail.txt';
  6. $Parser = new PhpMimeMailParserParser();
  7.  
  8. // 1. Specify a file path to the mime mail.
  9. $Parser->setPath($path);
  10.  
  11. // Once we've indicated where to find the mail, we can parse out the data
  12. $to = $Parser->getHeader('to'); // "test" <test@example.com>, "test2" <test2@example.com>
  13. $addressesTo = $Parser->getAddresses('to'); //Return an array : [[test, test@example.com, false],[test2, test2@example.com, false]]
  14.  
  15. $from = $Parser->getHeader('from'); // "test" <test@example.com>
  16. $addressesFrom = $Parser->getAddresses('from'); //Return an array : test, test@example.com, false
  17.  
  18. $subject = $Parser->getHeader('subject');
  19.  
  20. $text = $Parser->getMessageBody('text');
  21.  
  22. $html = $Parser->getMessageBody('html');
  23. $htmlEmbedded = $Parser->getMessageBody('htmlEmbedded'); //HTML Body included data
  24.  
  25. $stringHeaders = $Parser->getHeadersRaw(); // Get all headers as a string, no charset conversion
  26. $arrayHeaders = $Parser->getHeaders(); // Get all headers as an array, with charset conversion
  27.  
  28. // Pass in a writeable path to save attachments
  29. $attach_dir = '/path/to/save/attachments/'; // Be sure to include the trailing slash
  30. $include_inline = true; // Optional argument to include inline attachments (default: true)
  31. $Parser->saveAttachments($attach_dir,[$include_inline]);
  32.  
  33. // Get an array of Attachment items from $Parser
  34. $attachments = $Parser->getAttachments([$include_inline]);
  35. /*
Add Comment
Please, Sign In to add comment