PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I'm a novice in php and would appreciate any help and advice anyone can give me. I have an email form that does email the results back to me fine. However, I would also like to email or cc the results back to the person making the enquiry to confirm that their enquiry has been received. Here is the code:
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Where it says "From" is actually a space for additional headers. Usually people only use from in this field, but you can add a lot of other e-mail headers there. Like ones that define if its text or html, cc, bcc, reply-to, and etc.
There is examples on how to accomplish what you're looking for and more at the PHP manual page for the mail function:
Also, if you're familiar with the concept of OOP, a member of our community here has made an excellent PHP class that revolves entirely around sending e-mail. It's a big upgrade over just using your own set of functions or the PHP mail() function, so be sure to check it out here:
I'm really sorry, but I couldn't find the answer there. I'm very new to php and I may be missing something so I would be extremely grateful if someone could help me out.
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I've wrote a little function for the headers:
so like you can see, you can add almost everything to the header what you need, also the bcc options or cc options
if you want to make the cc field optional as well put it into the variables which the functions gets and then add it to the header like the bcc.
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]