Sending attachments in emails

I had to migrate my old ASP website to a new provider at the start of 2021. This involved learning PHP because my new provider doesn’t support ASP.
I administer a group of musicians and I frequently need to send emails to the whole group, or sometimes to a selected number. I have successfully re-programmed this in PHP and it works fine. The problem I have is when it comes to attaching files to the emails, which I sometimes need to do. It was pretty easy to do in my old ASP site but try as I might I cant get anything to work in PHP. I have researched it and found a few sites in the internet offering ‘simple’ file attachment routines but when I have tried them (even in a new page with none of my code) they dont work. Finally I found a site offering code for a complete contact form with attachments and that does work, but it has a number of fields on the form which I dont need, plus it seems to be very top heavy with numerous files and folders of files having to be copied to my website, plus it needs something called PHP Mailer which I have had to install in order for it to work.
Surely there must be a ‘no frills’ block of code somewhere which I could just add to my existing page to give the file attachment functionality I need?
Does anyone know of such a thing?
Many thanks for any help :slight_smile:

Sponsor our Newsletter | Privacy Policy | Terms of Service