Forum Moderators: coopster
if(mail(datadata)) {
echo "ok";
} else {
echo "not ok";
}
Problem is that in my case, it does still show the PHP errors when I turn off my mail server.
When mail server on:
it displays "ok" if mail is sent
Mail server off:
It can't send the mail; it shows PHP error and "not ok"
I need to get rid of the PHP error somehow...
Just change it so this to get rid of the echoing of the error:
if(mail(datadata)) {
echo "ok";
}
Then it should only echo "ok" when it works, and it will echo nothing when it doesn't
Hope this helps
eelix
if(@mail(datadata)) {
echo "ok";
} else {
echo "not ok";
}
the @ will hide any error messages that the PHP script may generate, so you will only see the "ok" or "not ok" that your script is producing
eelix