public static function run($dataDir = null) { $mapiMessage = new MapiMessage(); $mess = $mapiMessage->fromFile($dataDir . "MapiNote.msg"); # Note #1 $note1 = $mess->toMapiMessageItem(); $note1->setSubject("Yellow color note"); $note1->setBody("This is a yellow color note"); # Note #2 $note2 = $mess->toMapiMessageItem(); $note2->setSubject("Pink color note"); $note2->setBody("This is a pink color note"); $noteColor = new NoteColor(); $note2->setColor($noteColor->Pink); # Note #3 $note3 = $mess->toMapiMessageItem(); $note2->setSubject("Blue color note"); $note2->setBody("This is a blue color note"); $note2->setColor($noteColor->Blue); $note3->setHeight(500); $note3->setWidth(500); $personalStorage = new PersonalStorage(); $fileFormatVersion = new FileFormatVersion(); $pst = $personalStorage->create($dataDir . "MapiNoteToPST.pst", $fileFormatVersion->Unicode); $standardIpmFolder = new StandardIpmFolder(); $notes_folder = $pst->createPredefinedFolder("Notes", $standardIpmFolder->Notes); $notes_folder->addMapiMessageItem($note1); $notes_folder->addMapiMessageItem($note2); $notes_folder->addMapiMessageItem($note3); print "Added MapiNote Successfully." . PHP_EOL; }
public static function run($dataDir = null) { $mapiMessage = new MapiMessage(); $outlook_message_file = $mapiMessage->fromFile($dataDir . "Message.msg"); # Display sender's name print "Sender Name : " . $outlook_message_file->getSenderName(); #Display Subject print "Subject : " . $outlook_message_file->getSubject(); # Display Body print "Body : " . $outlook_message_file->getBody(); }
public static function run($dataDir = null) { # Create an instance of PersonalStorage $personalStorage = new PersonalStorage(); $pst = $personalStorage->create($dataDir . "sample1.pst", 0); # Create a folder at root of pst $pst->getRootFolder()->addSubFolder("myInbox"); # Add message to newly created folder $mapi_message = new MapiMessage(); $pst->getRootFolder()->getSubFolder("myInbox")->addMessage($mapi_message->fromFile($dataDir . "Message.msg")); print "Created PST successfully." . PHP_EOL; }