PDA

View Full Version : php mail() not workin



web242
06-10-2011, 08:03 AM
<?php

$ADDR = "xxxxxx@gmail.com";
if (mail($ADDR,"Testing","This is a test"))
echo "Mail function succeeded<br />";
else
echo "Mail function FAILED<br />";
?>

php mail is not working
is there a php ini setting related to php mail function

i am using 0fees.net free hosting

i hav tested many scripts from simple to advanced with headers and html too
nothing seems to work


would be great if someone using 0fees.net could help me with it

djr33
06-10-2011, 07:24 PM
Run the following as a new .php page:
<?php phpinfo(); ?>


That will give you a lot of information, and you can look to see whether mail() is enabled.

The server must have an available mail server-- it must be installed and enabled.

You can use php.ini and potentially other methods to enable it, but not if your host doesn't allow it. Contact them to ask, and I'm sure they also can help you set it up if it is allowed. If it's not allowed, even if you can get around it, it is probably breaking the TOS and your account may be suspended, so I don't recommend trying to force it to work if it isn't supposed to.

Free hosts are very limited, and you get what you pay for. They do work, but for only $5/mo there are many hosts that include fully working PHP, databases, probably more space, etc.