Yes, you have header errors.
Line ends with LF
$headers = "MIME-Version: 1.0\n";
instead of CRLF
$headers = "MIME-Version: 1.0\r\n";
Like I wrote before, no line in an email should end with LF.
And like I wrote in my last reply
<?php echo 'This is a'; ?>
single line
will display as
This is asingle line
Which obviously means that, if $randomhash is 'RHASH'
--PHP-mixed-<?php echo $random_hash; ?>
Content-Type: multipart/alternative; boundary="PHP-alt-<?php echo $random_hash; ?>"
will display as
--PHP-mixed-RHASHContent-Type: multipart/alternative; boundary="PHP-alt-RHASH"