I have a file on a web server that I want to email to an email address. The file looks ok on the server, but when it is sent to the email address as an attachment it is corrupted with "!/n " after 982 characters or 997 bytes. Or in words, ! linebreak space.
This is how it is mailed:
$fileinquestion = fopen ($root_path.'upload/portering.csv', 'a+');
$readfile = fgets ($fileinquestion);
mail($mail_to, 'File from server '.$date_in_subject, $readfile, $hdr);
fclose($fileinquestion);
unlink($root_path.'new/admin/upload/portering.csv');
Does anyone know why?