Read MIME data using PHP

前端 未结 1 1543
我寻月下人不归
我寻月下人不归 2021-01-21 20:50

I have a third party program which basically allows users to send email and then it displays it in the system. But the problem is that it is generating an output like this: I wa

相关标签:
1条回答
  • 2021-01-21 21:38

    PEAR::Mail_mimeDecode is a great class to decode MIME messages. Once installed, you can use it as such:

    $message = new Mail_mimeDecode($text);
    
    $params['include_bodies'] = true;
    $params['decode_bodies']  = true;
    $params['decode_headers'] = true;
    
    $messageStruct = $message->decode($params);
    //messageStruct is now an array representing the message
    // with all the parts properly included.
    
    0 讨论(0)
提交回复
热议问题