I am sending an email to the client with csv attached file. While my actual file have few numbers with prefix 0. But when getting the attachment in the mail, those prefix is being removed. I don't want those prefix to be removed. Attachment has to be as it is.
e.g:
number in actual csv: 002569854745
number in attached csv: 2569854745
here is my code
$myfile = __DIR__."/$filename";
$file_size = filesize($myfile);
$handle = fopen($myfile, "r");
$content = fread($handle, $file_size);
fclose($handle);
$multipartSep = '-----'.md5(time()).'-----';
$headers = array(
"From: from@gmail.com",
"BCC: bcc@wcities.com",
"Content-Type: multipart/mixed; boundary=\"$multipartSep\""
);
$attachment = chunk_split(base64_encode($content));
$txt = "test mail";
$body = "--$multipartSep\r\n"
. "Content-Type: text/plain; charset=ISO-8859-1; format=flowed\r\n"
. "Content-Transfer-Encoding: 7bit\r\n"
. "\r\n"
. "$txt\r\n"
. "--$multipartSep\r\n"
. "Content-Type: text/csv\r\n"
. "Content-Transfer-Encoding: base64\r\n"
. "Content-Disposition: attachment; filename=\"$filename\"\r\n"
. "\r\n"
. "$attachment\r\n"
. "--$multipartSep--";
//mail function