Closed CaMer0n closed 1 year ago
This example below from the documentation (https://mail-mime-parser.org/#basicsIntroduction) throws a fatal error. Message::parse doesn't exist.
Message::parse
use ZBateson\MailMimeParser\Message; $message = Message::parse($handleOrStreamOrString, true); $subject = $message->getHeaderValue('Subject'); $text = $message->getTextContent(); $html = $message->getHtmlContent(); $from = $message->getHeader('From'); $fromName = $from->getName(); $fromEmail = $from->getEmail(); $to = $message->getHeader('To'); // first email address can be accessed directly $firstToName = $to->getName(); $firstToEmail = $to->getEmail(); foreach ($to->getAllAddresses() as $addr) { $toName = $to->getName(); $toEmail = $to->getEmail(); } $attachment = $message->getAttachmentPart(0); $fname = $attachment->getFilename(); $stream = $attachment->getContentStream(); $attachment->saveContent('destination-file.ext');
Replacing it with Message::from() appears to fix it.
Message::from()
This example below from the documentation (https://mail-mime-parser.org/#basicsIntroduction) throws a fatal error.
Message::parse
doesn't exist.Replacing it with
Message::from()
appears to fix it.