I'm trying to send a MIME e-mail with a single attachment using a custom written class of mine.
On most servers I've used this class on, everything works fine.
On one server (typically, probably our most important one) something seems to be adding extra CRLF's in to the mail.
$this->body .=
"\r\n".
"--".$mime_boundary."\r\n".
"Content-Type: ".$attachment_mimetype."; name=\"".$attachment_filename."\"\r\n".
"Content-Transfer-Encoding: base64\r\n".
"Content-Disposition: attachment; filename=\"".$attachment_filename."\"\r\n".
"\r\n".
$base64_encoded_data;
That's the code that adds each attachment in to the mail body. Only one \r\n at the end.
As I said, on most servers this seems to work fine but on this particular server there is one extra \r\n on the end of every line - which screws up the mail headers so the attachment doesn't work. It also puts extra blank lines in between each line in the Base 64 encoded data, although I understand clients should ignore this.
Is there anything on the server I should be checking to see why it is doing this?
Any help greatly appreciated 🙂