php mail back for error plssssss help

Discussion in 'PHP' started by thanovice, Aug 10, 2009.

  1. #1
    Hi gays and gals i need some help. my email form does not work on my website.
    browser keeps coming back with a error



    This is my contact ini file
    ; Please set your contact configuration below.
    ;
    ; http://www.me--time.co.uk/

    [contact] ; info@me--time.co.uk sendTo = "info@me--time.co.uk"

    ; whether or not to validate the following fields
    validateName = true
    validateEmail = true
    validateMessage = true

    ; subject when left empty
    defaultSubject = "Website Feedback"

    ; page to redirect to on an error
    onError = "contactError.html"

    ; page to redirect to when successful
    onSuccess = "contactSuccess.html"

    ; maximum length of any input
    maxLength = 4096


    This my contact php file
    <?php $c=parse_ini_file("./contact1.ini");foreach($_POST as $k => $v){$i->$k=strip_tags(str_replace("\n","",$v));if(strlen($i->$k)>$c['maxLength']){header("Location: ".$c['onError']);exit;}}if(!$i->subject){$i->subject=$c['defaultSubject'];}if(($c['validateMessage']&&!$i->message)||($c['validateName']&&!$i->name)){header("Location: ".$c['onError']);exit;}if($c['validateEmail']){if(stristr($i->email,"@")){list($u,$h)=Split("@",$i->email);}else{$u="";}if(!$u||!$i->email||!checkdnsrr($h,"MX")){header("Location: ".$c['onError']);exit;}}$h="Content-type: text/html; charset=utf-8\nMIME-Version: 1.0\nFrom: \"".$i->name."\" <".$i->email.">\n"."Reply-to: ".$i->email."\n";if(Mail($c['sendTo'],$i->subject,$i->message,$h)){header("Location: ".$c['onSuccess']);}?>

    This is my contact html form code relating to php
     
    thanovice, Aug 10, 2009 IP
  2. wdstuff54

    wdstuff54 Well-Known Member

    Messages:
    639
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    110
    #2
    Hi,

    Can you post the errors you are getting?
     
    wdstuff54, Aug 10, 2009 IP
  3. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #3
    Yes what exactly is the error without thats it tough to troubleshoot
     
    Bohra, Aug 11, 2009 IP
  4. pubdomainshost.com

    pubdomainshost.com Peon

    Messages:
    1,277
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #4
    As already pointed out - for now and future, if you need help it would be wise to copy and print 'exact error message' that you receive.
    No one would dig into code without knowing the purpose or potential error area!
     
    pubdomainshost.com, Aug 11, 2009 IP