PHP code example of zbateson / mmp-crypt
1. Go to this page and download the library: Download zbateson/mmp-crypt 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/ */
zbateson / mmp-crypt example snippets
use ZBateson\MailMimeParser\Message;
// Parsing an encrypted message automatically uses the registered
// IMimeCrypt implementation to decrypt it.
$message = Message::from($rawEmail, false);
// If the message was encrypted, it will be an EncryptedMessage instance.
// getStream() / getTextContent() / etc. return decrypted content by default.
echo $message->getTextContent();
// Access the original encrypted stream if needed
if ($message instanceof \ZBateson\MmpCrypt\EncryptedMessage) {
$encryptedStream = $message->getEncryptedStream();
}