July 5, 201115 yr Hi Guys, This is annoying the hill out of me, I am trying to send an email with excel attachment using php. Do any one have any code? Youssef
July 5, 201115 yr Hi Guys, This is annoying the hill out of me, I am trying to send an email with excel attachment using php. Do any one have any code? Youssef http://www.finalwebsites.com/forums/topic/php-e-mail-attachment-script basically, you need to encode your excel attachment with base64, split it into chunks, set content encoding to 7bit and add that encoded string to the content of the email.
July 5, 201115 yr Author Thank you for your reply, This is a good place to start, but I am not sending a zipped folder I need to send an excel file. The excel file is in a folder called xsl so the path is xsl/working.xls. This will sound stupid, but in the same time I am new to php, here is the code: $headers .= "Content-type: text/html; charset=us-ascii\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-Type: application/octet-stream; name=\"xsl/\"\n"; $headers .= "From: $business\n"; $headers .= "Content-Disposition: attachment; filename=\"working.xls\"\n\n"; @mail("info@siblinis.com", "AB-MXR", "hello is it working ", $headers); Youssef http://www.finalwebsites.com/forums/topic/php-e-mail-attachment-script basically, you need to encode your excel attachment with base64, split it into chunks, set content encoding to 7bit and add that encoded string to the content of the email.
July 5, 201115 yr Thank you for your reply, This is a good place to start, but I am not sending a zipped folder I need to send an excel file. The excel file is in a folder called xsl so the path is xsl/working.xls. it doesnt really matter what you want to send, all you need to do is to open that file (fopen), read its content (fread), encode it (base64) and concat with your email's body (content data). you can try to use that mail_attachment function from this page, just instead of giving .zip file as an argument try to put your .xls file
Create an account or sign in to comment