Ben size istediğiniz amaçlar için yapamam korkuyorum.
Bildiğim kadarıyla söyleyebilirim, web sayfalarını hizmet yapmak istiyorsanız, tarayıcılar sayfaları render için böyle MIME yanıtları ile çalışmaz.
Bu mesajları nasıl çalıştığını bir örnek istiyorsanız, kendinize ekli bir e-posta göndermek ve e-posta istemcisi (değil webmail) üzerinde e-posta vücuda "Kaynağı görüntüle" seçeneğine gidin.
Sen MIME Multipart kodlamasını kullanarak aynı mesajı mesaj, eki ve muhtemelen diğer parçaları görürsünüz.
OTOH, if you want it to send email, there are libraries, like PHPMailer, that will do all the encoding for you.
If that's what you want, check this example at their website.
Edit:
Sen o zaman sadece yerine aslında e-posta göndermek, sonucunu kullanmak, mesajı oluşturmak için PHPMailer kullanabilirsiniz.
Böyle bir şey deneyin:
** Bu ** sadece bir başlangıç noktası için, denenmemiş kodu
<?php
require_once('../class.phpmailer.php');
$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
try {
$mail->MsgHTML(file_get_contents('contents.html'));
$mail->AddAttachment('images/phpmailer.gif'); // attachment
$mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
$mime_message = $mail->CreateBody();
echo $mime_message;
} catch (phpmailerException $e) {
echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
echo $e->getMessage(); //Boring error messages from anything else!
}
?>