i am using php mail function to sent attachment, but its not working. Here is my code:
$headers = array(
"Mime-Version: 1.0",
"Content-Type: text/html; charset=charset=UTF-8",
"From: Test <myemail>",
"Content-Disposition: attachment; filename=\"" . $_SERVER['DOCUMENT_ROOT']."/project_name/test.txt" . "\"\r\n"; // For Attachment
);
$headers = join("\r\n", $headers);
mail($to, $subject, $body, $headers);
Email sent successfully and file is attached, but the content is hidden.