Yii2. How to render .eml in a view?

1.5k views Asked by At

I have a string with an .eml message. How to render this email on the page of my site in some kind of frame?

Is there any composer extension, that could render .eml content as a regular mail app.

1

There are 1 answers

0
D.R. On BEST ANSWER

I used this extension

And snippet like this:

$parser = new PhpMimeMailParser\Parser();
$parser->setText($message);

$html = $parser->getMessageBody('html');

echo $html;

$html is wrapped in my view into proper <div>'s.