<table>
<tbody>
<?php
/* connect to gmail */
$hostname = '{domail.com:143/novalidate-cert}INBOX'; // domain.com instead of your site name
$username = '[email protected]'; //here your mail id
$password = 'password'; //here your password
/* try to connect */
$inbox = imap_open($hostname,$username,$password) or die('Cannot connect to Gmail: ' . imap_last_error());
/* grab emails */
$emails = imap_search($inbox,'ALL');
/* if emails are returned, cycle through each... */
if($emails) {
/* begin output var */
$output = '';
/* put the newest emails on top */
rsort($emails);
/* for every email... */
foreach($emails as $email_number) {
/* get information specific to this email */
$overview = imap_fetch_overview($inbox,$email_number,0);
$message = imap_fetchbody($inbox,$email_number,1.2);
$structure = imap_fetchstructure($inbox, $email_number);
$output.= '<tr class="'.($overview[0]->seen ? 'read' : 'unread').'">
<td class="mail-select">
<div class="checkbox checkbox-primary m-r-15">
<input id="checkbox1" type="checkbox">
<label for="checkbox1"></label>
</div>
<i class="fa fa-star m-r-15 text-muted"></i>
<i class="fa fa-circle m-l-5 text-warning"></i>
</td>';
$output.= '<td>
<a href="#" class="email-name">'.$overview[0]->from.'</a>
</td>';
$output.= '<td>
<a href="#" class="email-msg">'.$overview[0]->subject.'</a>
</td>
<td style="width: 20px;">
<i class="fa fa-paperclip"></i>
</td>';
$output.= '<td class="text-right">';
$mail_datetime=$overview[0]->date;
$cur_date=date('d-M-Y');
$mail_date=date('d-M-Y', strtotime($mail_datetime));
$mail_time=date('h:i A', strtotime($mail_datetime));
if($cur_date==$mail_date)
{
$output.=$mail_time;
}
else
{
$output.=$mail_date;
}
$output.= '</td>
</tr>';
}
echo $output;
}
/* close the connection */
imap_close($inbox);
?>
</tbody>
</table>
당신이 http://php.net/imap_open의 전체 예제를 시도 어떤 결과를 시도 ** 선택해 주셔서 감사합니다 사서함 ** ...? – deceze