Hi
I'd say I'm a reasonably competent PHP coder and usually have little trouble in finding some snippets of useful information and pulling it all together to create a solution for a problem. However, on this occasion I'm drawing a blank.
I have some code which creates a CSV file. I want to send this file by email to a single recipient.
Now, I'm happy with sending an email using PHP's mail() function. However, I'm lost when it comes to the attachment bit. The code examples I've seen have done some kind of special read of the file in "chunks" and I've also seen the base64_encode() function being used.
What seems to be lacking is any explanation of why a certain approach is taken. I can copy code until the cows come home but I don't understand it which irks me.
So, can anyone point me at a guide that explains the steps required to attach a file to an email? And useful code snippets for each step would be extremely welcome.
Thanks in advance
Rich