lawrence_dev
asked on
How do I add an email attachment to this mail script?
This email script sends text perfectly. I need to add an attachment (XLS file) to this email script. How do I accomplish?
I have tried several scripts such as PHPmailer on GitHub.com and cannot get them to work.
If you can suggest something easy that works...
(Attachment is in the same directory as script)
I have tried several scripts such as PHPmailer on GitHub.com and cannot get them to work.
If you can suggest something easy that works...
(Attachment is in the same directory as script)
$filename = 'backorders_2015-03-17.xls';
$to = $receiver;
$subject = $filename;
$message = 'backorders from today';
$message = str_replace("\n.", "\n..", $message);
$headers = 'From: $myemail' . "\r\n" .
'Reply-To: $myemail' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER