I have no idea why this won't work and I even tried it on another server and got Warning: Failed to Connect . I keep getting the same error on the mail() line can anyone see where I made an error

$mailTo = "youremail@whatever.com";
$msgSubject = "companyname";
$message = "name: $name\nemail: $email\nphone: $phone\nphone2: $phone2\ntalent: $talent\ncomments: $comments";
$extra = "From: $name\r\nReply-To: $email\r\n";
$xHeaders = "From: $email\nX-Mailer: PHP/" . phpversion();
mail ($mailTo, $msgSubject, $message, $extra, $xHeaders);

    could it bee the setup? Check out the php.ini file to see if the mail is proberly configured.

    Being on a windows server, the SMTP server must be set, on unix the sendmail should be set.

    Have a look at php.ini, and reply here if it's ok, or tell what it says 🙂

    Best regards
    Simon

      I'm using webhost4life hosting but i'm not able to find the php.ini file anywhere

        Yes I just tried that and it works but once i start adding the variables thats when it gives me the server error

          Thanks for your help but I think it was a server problem I emailed them and they said it was fixed and now it seems to work.

          Thanks.

            Write a Reply...