How to check if server has mail() active ?


#1

Hello

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

<?php 

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


$feedback = mail($name, 'zoomit@gmail.com', $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 http://digitalzoomstudio.net/phpinfo.php ?

Thanks!

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:


#2
Aw_Shucks said

I didn’t think GoDaddy.com supported PHP5.

99% of hosts moved to PHP5

I got it to work with http://www.freecontactform.com/free.php

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


#3

Hi Zoomit,

You could try:

echo function_exists(mail);

#4
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


#5

No problem :slight_smile:


#6

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?