I want to show whether email sent successfully or failed on the same form. I want to show the empty form after email sent successfully. How can i do it?
here is the form
<input type="text" name="name" />
<input type="text" name="email" />
<input type="submit" name="submit" />
<span>here i want to show msg<span>
mail()will returnTRUE“if the mail was successfully accepted for delivery”, so I guess have the form submit to the same page, handle the data using PHP at the top, save the return value of themail()function in a variable, and handle that boolean value in that variable in order to display what you want to display.