Send Email with attachments in PHP
- December 12th, 2009
- Write comment
Although there are ways to send email in PHP using PEAR and other libraries, sometimes you’ll get stuck in a situation where that either isn’t possible or just too much of a faff.
The other day I decided to create a function for this purpose that I can use in my own library of code.
It can be dropped into your include files and used for simple emails without attachments, HTML emails or complex emails with multiple attachments.
I haven’t spent a great deal of time on this so it might not be 100% but works well for me so let me know if there are any flaws that need to be taken care of.
You can download the function (and supporting functions) from here: send email with attachments in PHP
