I’ve spent the last day creating a script that will create a PDF-receipt when a customer buys something from our site. When the PDF is created, I save the output to a variable using ob_get_clean()
I then make this variable into a base64_encoded string. When I’m done doing that, I save the string to a database. Now, what I want to do after that is get the string and in some way save it as an attachment to an email, so that the user can download it as a file. I’ve tried Google, but I didn’t find anything helpful really.
I found this thread, but as far as I can see in the Codeigniter email-library (I might have missed it), the requested function wasn’t implemented. Here is the request though, Email class: add attachment from string
You can create your own library and send the email using the php mail function and the appropriate headers.