How to check if server has mail() active ?



I am testing an contact form on my server hosted by goDaddy. I am trying to send an email from flash/html but have not really succeeded … here is my php code


$name = $_POST['name']; 
$email = $_POST['email']; 
$destinationMail = $_POST['destinationMail'];
$message = $_POST['message'];
$headers = 'From:' . $email . "\r
" .
    'Reply-To:' . "\r
" .
    'X-Mailer: PHP/' . phpversion();

$feedback = mail($name, '', $message, $headers);

echo $feedback;


It seems to work fine … returns 1 in firebug … but the mail does not arrive in my inbox.

Maybe mail() function is not active on my server… is this checkable ?


EDIT: I can send mail from my wordpress contact form on the same server… so maybe the error is my php code… dunno what I am doing wrong :frowning:

Aw_Shucks said

I didn’t think supported PHP5.

99% of hosts moved to PHP5

I got it to work with

Anyway, the question stands, is the mail() function verifiable with phpinfo ? Thanks!


Hi Zoomit,

You could try:

echo function_exists(mail);

Aw_Shucks said

If you can see that your php file is being connected to, it will display in the activity window, showing its file path and it will state whether or not there is any kb. If your php is firing, then its file path and the total KB size of the php file will display. If you can’t see the php file being loaded by the browser after sending a message via your contact form, then the problem is in the php most likely. It is one way I learned the problem.

Well… the mail function works on my servers… I figured it out how to fix the form.

I was just wondering if a client comes to me and says the contact form does not work how to show him that his server does not have this capability …

Thanks @ravenwill , that should do the trick!

Thank you all, case solved I guess


No problem :slight_smile:


Well function can exist (like on my windows based server it should) but I don’t have a mail server so it won’t send the mail. Is it like that?