[quote]I am using the PHP mail function in my website, but it doesnt seem to work. Is there anything I need to set up before I use this function? Its not giving an error or anything… just nothing is happening. This is what it looks like-
Any help is appreciated
Remove the quotes a single quote states to take the string literally, therefore echo ‘$email’ would print $email not the value that the varable $email holds.
Your code should be:
$subject=“a message from my website”;
mail ($to, $subject, $body, $header);
Better yet, don’t use the header, I found out that it is possible for a users to add to the header. What I did was place the From: field and the remote IP inside the body of the message. But this was for emails to me only. Then should anyone spam me with the contact page, I knew their ip address to add to the htaccess file for blocking.
Hope this helps,