tags:

views:

37

answers:

2
<?php 
$headers = 'MIME-Version: 1.0' . "\r\n"; 
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
mail("[email protected]", "hello", "nothing",$headers);
echo "mail sent";
?>

but it does not actually send the mail please help me out with this

+2  A: 

The mail function is just an interface to the local mail server. The mail functionality in PHP relies on the machine PHP is running on to be correctly configured and able to dispatch e-mail. Check the mail system configuration on the machine.

pyrony
+3  A: 

check the following -

  1. check if your smtp server is running (you could either check through command line tools or try ftp'ing to port 25).
  2. If your smtp server is running. Then try to send a mail manually (without script). Use the command-line mail command (I am assuming you have unix here).

Also, when you run your script, what happens? It could be possible that your mail is in a Queue. From your terminal type 'mailq'. This shows the current emails in Queue & why they are there. Also there is a corresponding log to this. You could also check that out for info.

My guess is if all the above are running, you are good to go.

MovieYoda