I am using PHP’s mail function to send an email, but I am going to need to attach a file with that message.
For the most part I believe the item that is going to be attached is going to be a text file and I could just echo out the content into the email if I had to, but I am worried that that eventually the file type will turn into a PDF, Word Document, etc since to the people who will be uploading the files won’t know the difference between plain text and their own formats.
There’s a LOT that goes into that, I’d highly recommend working with a package that does all the work for you such as PHPMailer
There are more important things you can spend your time doing, someone else has already done the work.