2010-04-05 6 views

답변

2

내장 PHP IMAP 기능을 사용합니다. 다음은 샘플입니다.

$mbox = imap_open ("{yourserver.com:110/pop3/novalidate-cert}INBOX", "[email protected]", "myPassword"); 
if (!$mbox) { 
    return false; 
} 
$m_search = imap_search($mbox, 'UNDELETED'); 
     $messages = array(); 
     if($m_search < 1) { 
      return 'No New Messages'; 
     } else { 
      foreach ($m_search as $item) { 
       $headers = imap_headerinfo($mbox, $item); 
       $struct = imap_fetchstructure($mbox, $item); 
       $body = imap_body($mbox, $item); 

       $headers->subtype = $struct->subtype; 
       $headers->body = $body; 

       $messages[] = $headers; 

      } 
     } 

     imap_close($mbox); 
관련 문제