Re: Mail problem

From: Date: Fri, 30 Aug 2002 08:18:02 +0000
Subject: Re: Mail problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-114617@lists.php.net to get a copy of this message
Hello, On 08/30/2002 04:46 AM, Mark Colvin wrote:
The script below works on my development web server which sits on our company LAN. When I transfer the script to our isp hosted webserver, the script does not work. I changed 192.168.10.9/iarnaweb/ to read localhost/ for the isp webserver version (I have also tried replacing localhost with the actual ip address). On my development server, the email is sent and the redirection happens but on the production server neither of these happens. Any ideas? <?PHP $toaddress = "mark.colvin@ccmltd.co.uk"; $subject = "Enquiry via Web Site."; $mailcontent = "Customer Name: ".$name."\n"
                 ."Position: ".$position."\n"
                 ."Company Name: ".$company."\n"
                 ."Address: ".$address."\n"
                 ."E-mail: ".$email."\n"
                 ."Tel No: ".$telno."\n"
                 ."Customer Comments: ".$enquiry."\n";
mail($toaddress, $subject, $mailcontent); header("Location: http://192.168.10.9/iarnaweb/contactack.html"); ?>
The mail function mail fail for many reasons but you are not checking its return value. Possibly it is just PHP configuration issue on your server. Which platform do you use? Another point is that the Location: header is meant to be interpreted by the user browser, not your server. So, it should include the real server domain because localhost for each user is their own machine, not your server. -- Regards, Manuel Lemos

« previous php.general (#114617) next »