Hi, I have several mail() scripts that have worked fine on our current host. One sends an email to the customer, the other to our admin.
Since moving to a new dedicated server (FreeBSD 4.8, PHP 4.3.2, Apache, Qmail) we are having the problem where any HTML email sent from the site, to an address on the same server, displays the html code only, rather than the laid out HTML info.
However, if we send the mail to an address external to our server, it seems to work fine.
I have tested this with several mail() functions, including a simple "Hello World" one, with the same effect.
After playing around, I found that if I comment out the header entry "MIME-Version: 1.0\r\n" and make sure that "Content-type: text/html; charset=iso-8859-1\r\n" is appended to the header variable LAST, it works. If this line is not last, all other header entries are displayed in the email content, rather than in the header.
Has anyone seen this before? Surely it is a problem between PHP and Qmail?
One of the scripts is so complex, I can't get away with commenting out the line as stated above. (It's not my design and uses some sort of content checking) so I'm hoping to find an answer to this somewhere.
PS. Our host has been looking into it also, but cannot explain it.
Thanks
Aaron
Since moving to a new dedicated server (FreeBSD 4.8, PHP 4.3.2, Apache, Qmail) we are having the problem where any HTML email sent from the site, to an address on the same server, displays the html code only, rather than the laid out HTML info.
However, if we send the mail to an address external to our server, it seems to work fine.
I have tested this with several mail() functions, including a simple "Hello World" one, with the same effect.
After playing around, I found that if I comment out the header entry "MIME-Version: 1.0\r\n" and make sure that "Content-type: text/html; charset=iso-8859-1\r\n" is appended to the header variable LAST, it works. If this line is not last, all other header entries are displayed in the email content, rather than in the header.
Has anyone seen this before? Surely it is a problem between PHP and Qmail?
One of the scripts is so complex, I can't get away with commenting out the line as stated above. (It's not my design and uses some sort of content checking) so I'm hoping to find an answer to this somewhere.
PS. Our host has been looking into it also, but cannot explain it.
Thanks
Aaron