mail() sends email twice
I've created a contact form and a script which uses the mail() function to email the data entered.
My script appears to be functioning as I want, but two emails arrive at the destination inbox. The first email is from the default 'nobody' address of the Apache server, and the second email arrives with the correct email headers which I have specified.
Can anyone help me find why this is happening and how to stop it?
can you show us your mail function? so probably we can help you.
First of all show your code so that we can see if anything wrong with the code. But since you have said that first email sender is 'nobody' there maybe something wrong with the configurations. So see if you are able to see the apache/php mail sending configurations. Or just try once sending a simple plain mail using mail() function once and see how does it work.
False alarm. Whilst creating a minimal test case to post here I found my error. A very obvious one!
There's a tip in there for troubleshooting your own work!