View Full Version : Script doesnt function please HELP

03-04-2007, 11:53 PM
Please here is my script and it doesnt function

$email = $_REQUEST['email'] ;
$message= $_REQUEST['message'];

if (!isset($_REQUEST['email'])) {
header( "Location: http://www.eyes4u.ch/feedback.html" );
elseif (empty($email) || empty ($message)) {

header( "Expires: Mon, 19 Feb 2007 01:00:00 GMT" );
header( "Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT" );
header( "Cache-Control: no-cache, must-revalidate" );
header( "Pragma: no-cache" );



Oops, It looks as if you forgot to enter your email or message. Please press the
back button on your browser and try again.<br />
Thank you


else {
mail( "info[at]eyes4u[dot]ch", "Feedback Form Results",
$message, "From: $email" );
header( "Location: http://www.eyes4u.ch/thanks.html" );

Here is the error I get

Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\sites\premium4\emory\webroot\sendmail.php on line 34

Warning: Cannot modify header information - headers already sent by (output started at C:\sites\premium4\emory\webroot\sendmail.php:34) in C:\sites\premium4\emory\webroot\sendmail.php on line 35

My hosting which is Brinkster says I can get the answer here but I cant find it

Here the link to my homepage

Thank you for your help

03-05-2007, 12:51 AM
They want you to use this script to send mails:

03-05-2007, 08:40 AM
But then I dont get any messages from my visitors but the message I wrote in the script.

03-05-2007, 04:41 PM
the "localhost" error is caused by you testing this script on your own computer. Try this script on your online server and it should resolve this.
(your localhost does not come equipt with a mail server).

As for the other information, could you post the sendmail.php header info?

03-05-2007, 04:54 PM
The FAQ at your web hosting company contains two pieces of information -

The SMTP host setting (which your code in the first post is not specifically setting, so it is using the default "localhost", and there is no SMTP server at that host name) needs to be something like "mail.yourdoman.com"

The second piece of information is that you need to use authentication against one of your mail boxes on the mail server. The PHP mail(...) function cannot do authentication. It is necessary to use a script that opens a socket connection to the mail server, which is what the phpmailer class code in the FAQ will do.