/**
  * @param Message $message
  *
  * @return mixed
  */
 public function newEmail(Message $message)
 {
     $date = new \DateTime();
     $date->setTimeStamp($message->getDate());
     echo 'Subject : ' . $message->getSubject() . "\n";
     echo 'Uid     : ' . $message->getUid() . "\n";
     echo 'Date    : ' . $date->format('Y/m/d H:i:s') . "\n";
 }
 private function createItem(Message $message)
 {
     $item = new Item();
     $item->title(utf8_encode($message->getSubject()))->description(utf8_encode($message->getMessageBody()))->url($this->url . $message->getUid() . '.html')->pubDate($message->getDate())->guid($message->getUid())->appendTo($this->channel);
     file_put_contents($this->dir . '/' . $message->getUid() . '.html', $message->getMessageBody(true));
 }