I have a an online email form which calls mail.php.
In the mail.php I check for various variables and send the email using the mail() function.
Now, sending the mail works fine. The problem is that the users get a blank page.
So I chucked in a "thank you" note, and telling them that they will be redirected to the main page.
I use header('location:index.php') to redirect users.
The problem is that I cannot have any output before the header, but I want the users to know that the mail have been sent successfully.
How can I work around this?
Here's the code (that does not work because of the txt output).
mail("my_MailAdd","subj_txt",$msg, "from: $from <mail_add>");
echo "Thank you";
sleep(4);
header('location:index.php');