Saturday, 15 May 2010

email - Line break issue in PHP mail sending -



email - Line break issue in PHP mail sending -

im having problems line breaks when sending mail service php. main issue here is, line breaks doesnt work in mails attachment in plain text it's looks good. using iis server.

$filename = basename($file); $file_size = filesize($file); $content = chunk_split(base64_encode(file_get_contents($file))); $uid = md5(uniqid(time())); //$from = str_replace(array("\r", "\n"), '', $from); // prevent email injection $header = "from: form - test \r\n" ."mime-version: 1.0\r\n" ."content-type: multipart/mixed; boundary=\"".$uid."\"\r\n\r\n" ."this multi-part message in mime format.\r\n" ."--".$uid."\r\n" ."content-type:text/plain; charset=iso-8859-1\r\n" ."content-transfer-encoding: 7bit\r\n\r\n" .$message." ".$companyinfo."\r\n\r\n" ."--".$uid."\r\n" ."content-type: application/octet-stream; name=\"".$filename."\"\r\n" ."content-transfer-encoding: base64\r\n" ."content-disposition: attachment; filename=\"".$filename."\"\r\n\r\n" .$content."\r\n\r\n" ."--".$uid."--";

when see in outlook email client it's showing in paragraph type , other client missing line breaks. help?

if email of text/html content-type need utilize html tag line breaks:

<br />

if in plain text/plain can utilize

\n

php email formatting format sendmail

No comments:

Post a Comment