0

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);
user3396295
  • 35
  • 1
  • 1
  • 7
  • Is this your current code verbatim? You might be missing a `"` and a `;` on at least one line... ;) – summea Apr 04 '14 at 17:37
  • 1
    @summea - I copyed and removed the un-necessary parts... – user3396295 Apr 04 '14 at 17:50
  • Is this question anything like _[this other question (includes answers)](http://stackoverflow.com/questions/8626786/proper-way-to-decode-incoming-email-subject-utf-8)_? – summea Apr 04 '14 at 17:58

0 Answers0