Hi,
How to attach word document file (*.doc) in a mail ? I tried to attach it with the blow codes...
$headers .= "Content-Type: application/msword; charset=iso-8859-1\n";
$headers .= "Content-Transfer-Encoding: ". "base64\n";
$headers .= "Content-Disposition: attachment\n\n" ;
$filedata = implode(file('m ailattach.doc') , '');
$headers .= chunk_split(bas e64_encode($fil edata));
mail($to, $subject, $body, $headers);
I can get attachment file from this code. But i can get only *.txt format files only not *.doc. Even the file also correpted when i download from mail. I couldn't read the content from that file. How to solve this problem ?
Thanks.
How to attach word document file (*.doc) in a mail ? I tried to attach it with the blow codes...
$headers .= "Content-Type: application/msword; charset=iso-8859-1\n";
$headers .= "Content-Transfer-Encoding: ". "base64\n";
$headers .= "Content-Disposition: attachment\n\n" ;
$filedata = implode(file('m ailattach.doc') , '');
$headers .= chunk_split(bas e64_encode($fil edata));
mail($to, $subject, $body, $headers);
I can get attachment file from this code. But i can get only *.txt format files only not *.doc. Even the file also correpted when i download from mail. I couldn't read the content from that file. How to solve this problem ?
Thanks.
Comment