php coding - how to code for multiple email recepients
I have two questions:
After much tweaking I was finally able to get the php script correct so that a form can be sent to me. Now I would like to know what I need to do so that I can have the form sent to me AND to one other email at the same time. My script looks something like this:
I have tried to insert another email address using just a comma after the first address - tried this in many different configurations and I can't get it to work. Anyone out there that can tell me what I need to add to my code? Also, if I decided to send it to three people, what would that look like?
Question 2: Is it possible to include code that would send the form to me, send it to one other person and to automatically download a copy of the completed form to the computer of the person completing the form?
The server may be configured to only allow one recipient, in which case you need to repeat the code used to send it, but change the email address.
If you want to set it to automatically download, assuming the page has no other output then you can set the page header to force downloading as an attachment, set a file name, then everything that is echo'd will make up the contents of the file.
Check out this page: http://www.ryboe.com/tutorials/php-headers-force-download
But change the Content-Type header to "text/plain", and instead of readfile() you just echo the contents of the form.
It'll take a bit of tweaking to get it to work though.
Note that just because you request it to be downloaded, it may not be. Some browsers (not the main ones as far as I know) may ignore the request to treat it like a download, and even if they don't the user may not choose download it.