Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jul 2006
    Location
    Switzerland
    Posts
    57
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Question Script doesnt function please HELP

    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" );


    ?>

    <html>
    <head><title>Error</title></head>

    <body>
    <h1>Error</h1>
    <p>
    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

    </p></body></html>

    <?
    }
    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
    http://kb.brinkster.com/Kb.asp?kb=108154

    Here the link to my homepage
    http://www.eyes4u.ch/feedback.html

    Thank you for your help
    Last edited by Webgirl; 03-05-2007 at 07:14 AM.

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,642
    Thanks
    2
    Thanked 405 Times in 397 Posts
    They want you to use this script to send mails:
    http://kb.brinkster.com/Kb.asp?kb=107593

  • #3
    New Coder
    Join Date
    Jul 2006
    Location
    Switzerland
    Posts
    57
    Thanks
    3
    Thanked 0 Times in 0 Posts
    But then I dont get any messages from my visitors but the message I wrote in the script.

  • #4
    New Coder
    Join Date
    Feb 2007
    Location
    Near Belfast
    Posts
    38
    Thanks
    0
    Thanked 1 Time in 1 Post
    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?
    Knowledge is only half the value of passion. But passion doesn't pay the bills.

  • #5
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,027
    Thanks
    2
    Thanked 315 Times in 307 Posts
    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.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •