开发者

simple form to send email

开发者 https://www.devze.com 2023-01-12 18:16 出处:网络
I 开发者_StackOverflowwant 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?

I 开发者_StackOverflowwant 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>


php mail()

Returns TRUE if the mail was successfully accepted for delivery, FALSE otherwise.
this will help. There are some examples.
Remember! accepted for delivery is NOT the same as Delivered!


mail() will return TRUE "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 the mail() function in a variable, and handle that boolean value in that variable in order to display what you want to display.

0

精彩评论

暂无评论...
验证码 换一张
取 消