헬프 데스크 티켓 응답으로 들어오는 전자 메일을 파이프 처리하는 헬프 데스크 파이프 처리기를 쓰고 있습니다. 일부 전자 메일은 완벽하게 잘 들어오고 있으며, 다른 전자 메일은 텍스트의 뒤죽박죽으로 들어오고 3D는 모두 하나의 거대한 문자열로 뭉쳐져 있습니다. 누구나 그것을 일반 텍스트로 디코딩하는 방법에 대한 아이디어를 가지고 있습니까?Zend_Mail 및 = 0D = 0A = 3D = 3D = 3D = 3D = 3D
public function parseEmailMessage(Zend_Mail_Message $msg)
{
if ($msg->isMultiPart()) {
$arrAttachments = array();
$body = '';
// Multipart Mime Message
foreach (new RecursiveIteratorIterator($msg) as $part) {
try {
$mimeType = strtok($part->contentType, ';');
// Parse file name
preg_match('/name="(?<filename>[a-zA-Z0-9.\-_]+)"/is', $part->contentType, $attachmentName);
// Append plaintext results to $body
// All other content parts will be treated as attachments
switch ($mimeType) {
case 'text/plain':
$body .= trim($part->getContent()) . "\n";
break;
case 'text/html':
$body .= trim(strip_tags($part->getContent));
break;
default:
$arrAttachments[] = array(
'attachment_mime' => $mimeType,
'attachment_name' => $this->filterFileName($attachmentName['filename']),
'base64data' => trim($part->getContent())
);
}
} catch (Zend_Mail_Exception $e) {
// ignore
}
}
return array($body, $arrAttachments);
} else {
// Plain text message
return array(trim($msg->getContent()), array());
}
}
죄송합니다. 여기에 = 0D = 0A = 3D = 3D = 3D = 3D가 무엇인지 보러 와야했습니다. –