I wrote a code that scan and print emails from email folder
the problem is when I get emails with Hebrew language - than I see:
subject: =?UTF-8?B?16DXldep15Ag15HXk9eZ16fXlCDXkdei15HXqNeZ16o=?
how can I fix it?
$imap = imap_open($gmailhostname, $gmailusername, $gmailpassword);
$message_count = imap_num_msg($imap);
for ($i = 1; $i <= $message_count; ++$i) {
$header = imap_header($imap, $i);
$body = imap_fetchbody($imap, $i);
$subject = $header->subject;
echo " subject: $subject ";
}
imap_close($imap);