my php email for is sending emails every time the page is refreshed. For example the user is filling out the form and sending it with the send button. That\'s all fine and g
You should use different files, at different URLs to handle the actions:
For example:
In your form
In sendmail.php
// same code as above except:
if(!$mail->Send()) {
header("Location: success.php");
} else {
header("Location: error.php");
}
See the doc for details.
In success.php
Oh yeah ;)
In error.php
Ooops :(