PHP IMAP mail decode subject - mb_decode_mimeheader - destroy EUR symbol

86 views Asked by At

We are sucessfully reading IMAP mail for some following business logic. Now we have noticed that when decrypting the email subject, the EUR symbol is corrupt. To fetch all mails and decode the subject we are using something like this:

$imapInstance; // already given and initialiced;
$mails = imap_fetch_overview($imapInstance, 0 . ':' 2); // for example

foreach ($mails as $mail) {
    $mail->subject = mb_decode_mimeheader($mail->subject)
}
  • Subject in Mail = TestTest€, öäüÖÄÜ@ß'"&&/()=?!"§$%²³|;TestTest
  • Subject before decode = =?utf-8?B?VGVzdFRlc3TigqwsIMO2w6TDvMOWw4TDnEDDnyciJiYvKCk9PyEiwqckJcKy?= =?utf-8?B?wrN8O1Rlc3RUZXN0?=
  • Subject after decode = TestTest¤, öäüÖÄÜ@ß'"&&/()=?!"§$%²³|;TestTest

After some research, I also tried 'iconv_mime_decode' & 'imap_utf8'. In both cases, the result was the same. Does anyone have a tip for me about what could be going wrong? The emails were sent with Outlook.

0

There are 0 answers