I've got a code that attaches a file to email, however I can't seem to wrap lines in the message. \n just disappear. Here's what I've got:
$headers .= "\nMIME-Version: 1.0\n" .
"Content-Type: multipart/mixed;\n" .
" boundary=\"{$mime_boundary}\"";
// Add a multipart boundary above the plain message
$message = "This is a multi-part message in MIME format.\n\n" .
"--{$mime_boundary}\n" .
"Content-Type: text/html; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$message . "\n\n";
$message .="Dear $name,\r\nThank you for requesting $subject. Please find attached PDF file with the latest information.\r\nFor your convenience these updates are emailed automatically on a monthly basis to all Spine Sector Meta Tracker.\r\nIf you wish not to receive these updates, please visit your Spine Sector Meta Tracker account and change Email Updates under User Preferences.\r\nBest Regards,\rMDMR Support Team\n";
// Add file attachment to the message
$message .= "--{$mime_boundary}\n" .
"Content-Type: {$fileatt_type};\n" .
" name=\"{$fileatt_name}\"\n" .
"Content-Transfer-Encoding: base64\n\n" .