PHP code example of golded-dev / laravel-ftn-msg

1. Go to this page and download the library: Download golded-dev/laravel-ftn-msg library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

golded-dev / laravel-ftn-msg example snippets




declare(strict_types=1);

use Golded\Ftn\Msg\MsgReader;

$reader = new MsgReader();

foreach ($reader->read('/path/to/messages/MSG/THE_SAFE') as $message) {
    echo $message->msgno.PHP_EOL;
    echo $message->fromName.' -> '.$message->toName.PHP_EOL;
    echo $message->subject.PHP_EOL;
    echo $message->bodyText.PHP_EOL;
}

use Golded\Ftn\Msg\MsgReader;
use Golded\Ftn\ReaderOptions;

$messages = new MsgReader()->read(
    path: '/path/to/messages/MSG/NETMAIL',
    options: new ReaderOptions(fallbackCharset: 'CP437'),
);