Skip to content

Fatal error: Declaration of PhpPec\PecMessage::getTestiOriginali() must be compatible with PhpPec\PecMessageInterface::getTestiOriginali($inHtml = false) in C:\Program Files\NetMake\v9-php81\wwwroot\PEC\PhpPec\PecMessage.php on line 152 #8

@SandroL-als

Description

@SandroL-als

Ciao, ho provato a far funzionare la classe ma ricevo l'errore nel titolo, sicuramente sbaglio qualcosa, non ho mai usato Fetch, sino ad ora per "leggere" la posta ho usato IMAP ma per la PEC non sono riuscito a scaricare gli allegati originali.
il codice:
`require_once("vendor/autoload.php");
use Fetch\Server;
use Fetch\Message;

require_once("PhpPec/PecMessageInterface.php");
require_once("PhpPec/PecServer.php");
require_once("PhpPec/PecMessage.php");

use PhpPec\PecMessageInterface;
use PhpPec\PecMessage;
use PhpPec\PecServer;

//$server = new Server('imaps.pec.aruba.it', 993);
$server = new PecServer('imaps.pec.aruba.it', 993);
$server->setAuthentication('mgcarrentalsrl.multe@pec.it', 'password');

$messages = $server->getMessages();

foreach ($messages as $message) {
echo "Subject: {$message->getSubject()}", PHP_EOL;

$allegati = $message->getAllegati();
foreach($allegati as $allegato) {
    echo "Nome file: ".$allegato->getFileName()."\n";
    echo "Dimensione: ".$allegato->getSize()."\n";
    echo "MIME: ".$allegato->getMimeType()."\n";
    file_put_contents($allegato->getFileName(), $allegato->getData());

}

}
`

image

un'ultima domanda posso parzializzare la lettura usando UID?
Grazie in anticipo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions