显示电子邮件发件人IMAP-PHP

时间:2016-10-07 11:14:53

标签: php gmail imap

我将我的网站与我的Gmail帐户关联,并显示所有消息

问题是我想显示我尝试使用['header']->senderaddress

的电子邮件发件人

但没有任何结果

我的索引代码



$email = new EmailReader();
  print_r($email->search());

  echo "There are ".$email->Getinboxcount() . 'Messages';

  for($i=0;$i<$email->Getinboxcount();$i++){
    echo '<br><br>';
    echo "<h3>Message received from</h3>" . $email->GetMessage($i)['header']->fromaddress;
    echo '<br><br>';
    echo "<h3>Message received from email : </h3>" . $email->GetMessage($i)['header']->senderaddress;
    echo '<br><br>';
    echo "<h3>date</h3>" . $email->GetMessage($i)['header']->date;
    echo '<br><br>';
    echo "<h3>subject/h3>" . $email->GetMessage($i)['header']->subject;
    echo '<br><br>';
    echo "<h3>text</h3>" . $email->GetMessage($i)['body_text'];
    echo '<br><br>';
    echo '*****************************************************************************';

  }
&#13;
&#13;
&#13;

0 个答案:

没有答案