I am having trouble using the mail() function in php. I am currently learning about it at treehouse but no matter what i do, i just couldnt seem to send the email.
Previously, there were a lot of codes used to avoid spammers and bots. I tried to dumb it down to the simplest and it still wouldn't work, meaning that i still can't use it to send an email despite uploading the file to a free web host that supports php just for testing purposes using filezilla.
May I know what did i do wrong?
The webhost name is www.000webhost.com
Below is the code:
<?php
$to="theteam@theopencircles.com";
$subject="this is from your mother";
$message=$_POST["message"];
if($_POST){
mail($to,$subject,$message);
}
?>
<!DOCTYPE html>
<html>
<body>
<form method="post" action="">
<input type = "text" name="message" id="message"/>
<input type = "submit" name = "submit" id="submit" value="submit"/>
</form>
</body>
</html>