Connecting Tech Pros Worldwide Forums | Help | Site Map

php mail() function is not working

prabirchoudhury's Avatar
Familiar Sight
 
Join Date: May 2009
Location: Wellington, New Zealand
Posts: 152
#1: May 19 '09
mail() function stopped working after server upgraded to php 4.4.4. not getting any error on server error-log file and the php page . any idea please.


using mail function code

Expand|Select|Wrap|Line Numbers
  1. $to = "to@domain";
  2. $subject = "Test mail";
  3. $message = "Hello ! This is a simple email message frm fis server.";
  4. $message .= $contact;
  5. $from = "from@domain";
  6. $headers = "From: $from";
  7. mail($to,$subject,$message,$headers);
  8.  
  9.  
  10.  
  11.  
many thanks

Member
 
Join Date: May 2009
Posts: 81
#2: May 20 '09

re: php mail() function is not working


Try adding this to your script and test it:
error_reporting(E_ALL);
ini_set('display_errors', true);

You should also ensure your php.ini configuration is pointing to your mailer server.
Reply

Tags
mail function, mail(), php mail, php mail function