Results 1 to 2 of 2

Thread: PHP Email Form not sending to email?

  1. #1
    Join Date
    Jan 2008
    Location
    Colorado
    Posts
    38
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Exclamation PHP Email Form not sending to email?

    I'm stuck. I got all the coding to work from the visitor's side. But its not sending to my email. Can anyone take a look and tell me what i've done wrong? Or if the code is right is it just my host that isn't allowing it? Thanks for your time!

    Code:
    <html>
    <head>
    <title>Analysis</title>
    </head>
    <body>
    <form method="post" action="sendmail.php">
    Name:<input type="text" size="12" maxlength="12" name="name"><br />
    Full Address:<input type="text" size="12" maxlength="100" name="address"><br />
    Phone:<input type="text" size="12" maxlength="14" name="phone"><br />
    
    Estimated value of home (Appraisal or tax value):<input type="text" size="12" maxlength="100" name="estvalue"><br />
    
    Original loan balance: <input type="text" size="12" maxlength="100" name="orgbal"><br />
    
    Current loan balance: <input type="text" size="12" maxlength="100" name="currbal"><br />
    
    Type of loan:<br>
    ( fixed, variable, arm, interest only, neg am?) <input type="text" size="12" maxlength="100" name="loantype"><br />
    
    Original Term: (How many years) <input type="text" size="12" maxlength="100" name="orgterm"><br />
    
    Remaining Term: <input type="text" size="12" maxlength="100" name="remainingterm"><br />
    
    Rate of mortgage: <input type="text" size="12" maxlength="100" name="ROM"><br />
    
    Full Monthly Payment: <input type="text" size="12" maxlength="100" name="FMP"><br />
    
    Amount to Escrow: <input type="text" size="12" maxlength="100" name="AtoE"><br />
    
    2nd Mortgage Original balance if applicable: <input type="text" size="12" maxlength="100" name="MorBal2"><br />
    
    Current 2nd balance: <input type="text" size="12" maxlength="100" name="Curr2ndBal"><br />
    
    Type of mortgage: <input type="text" size="12" maxlength="100" name="ToM2"><br />
    
    Term: <input type="text" size="12" maxlength="100" name="Term2"><br />
    
    Remaining Term: <input type="text" size="12" maxlength="100" name="RemainingTerm2"><br />
    
    Rate: <input type="text" size="12" maxlength="100" name="Rate2"><br />
    
    Full Payment: <input type="text" size="12" maxlength="100" name="FMP2"><br />
    
    Other debts to be paid off. 
    If applicable what is the interest rate, term, and monthly payment?:<br><textarea rows="12" cols="20" name="otherdebts" wrap="physical">(ie: Credit cards, car loans, loans)</textarea><br />
    
    Monthly Net Income:<br>
      (If commission give average amount per month) <input type="text" size="12" maxlength="100" name="MNI"><br />
    
    Type of Income:<br />
    <select name="incometype">
    <option value="weekly">Weekly</option>
    <option value="biweekly">Bi-Weekly</option>
    <option value="monthly">Monthly</option>
    <option value="semimonthly">Semi-Monthly</option</select><br />
    
    Spouses Monthly Net Income if applicable: <input type="text" size="12" maxlength="100" name="SpouseMNI"><br />
    
    Spouses Type of Income: <br />
    <select name="incometypespouse">
    <option value="weekly">Weekly</option>
    <option value="biweekly">Bi-Weekly</option>
    <option value="monthly">Monthly</option>
    <option value="semimonthly">Semi-Monthly</option</select><br />
    
    How much money is left at the end of the month after life happens?: <input type="text" size="12" maxlength="100" name="moneyleft"><br />
    
    <input type="submit" value="submit" name="submit"><br />
    </form><br />
    </body>
    </html>
    PHP Code:
    <?php
    $name 
    $_REQUEST["name"];
    $address $_REQUEST["address"];
    $phone $_REQUEST["phone"];
    $estvalue $_REQUEST["estvalue"];
    $orgbal $_REQUEST["orgbal"];
    $currbal $_REQUEST["currbal"];
    $loantype $_REQUEST["loantype"];
    $orgterm $_REQUEST["orgterm"];
    $remainingterm $_REQUEST["remainingterm"];
    $ROM $_REQUEST["ROM"];
    $FMP $_REQUEST["FMP"];
    $AtoE $_REQUEST["AtoE"];
    $MorBal2 $_REQUEST["MorBal2"];
    $Curr2ndBal $_REQUEST["Curr2ndBal"];
    $ToM2 $_REQUEST["ToM2"];
    $Term2 $_REQUEST["Term2"];
    $RemainingTerm2 $_REQUEST["RemainingTerm2"];
    $Rate2 $_REQUEST["Rate2"];
    $FMP2 $_REQUEST["FMP2"];
    $otherdebts $_REQUEST["otherdebts"];
    $MNI $_REQUEST["MNI"];
    $incometype $_REQUEST["incometype"];
    $SpouseMNI $_REQUEST["SpouseMNI"];
    $incometypespouse $_REQUEST["incometypespouse"];
    $moneyleft $_REQUEST["moneyleft"];
    $embody "$name $address $phone $estvalue $orgbal $currbal $loantype $orgterm $remainingterm $ROM $FMP $AtoE $MorBal2 $Curr2ndBal $ToM2 $Term2 $RemainingTerm2 $Rate2 $FMP2 $otherdebts $MNI $incometype $SpouseMNI $incometypespouse $moneyleft";

      
    mail"euphoria.studio@gmail.com""Analysis Request"$embody"From: $name);
      
    header"Location: http://formtest.freehostia.com/analysis.html" );
    ?>
    Edit: [icode][/icode] is for short codes only.
    Last edited by tech_support; 02-13-2008 at 05:58 AM.

  2. #2
    Join Date
    Jan 2007
    Posts
    82
    Thanks
    30
    Thanked 18 Times in 17 Posts

    Default Re:

    I'm no guru at all, but I ran into a similar problem so let's see if I can help.

    I beleive your script is fine, and executes as it should. The most likely cause for not receiving the email is improperly formatted headers being blocked.

    Try editing your PHP code to this:

    PHP Code:
    <?php
    $name 
    $_REQUEST["name"];
    $address $_REQUEST["address"];
    $phone $_REQUEST["phone"];
    $estvalue $_REQUEST["estvalue"];
    $orgbal $_REQUEST["orgbal"];
    $currbal $_REQUEST["currbal"];
    $loantype $_REQUEST["loantype"];
    $orgterm $_REQUEST["orgterm"];
    $remainingterm $_REQUEST["remainingterm"];
    $ROM $_REQUEST["ROM"];
    $FMP $_REQUEST["FMP"];
    $AtoE $_REQUEST["AtoE"];
    $MorBal2 $_REQUEST["MorBal2"];
    $Curr2ndBal $_REQUEST["Curr2ndBal"];
    $ToM2 $_REQUEST["ToM2"];
    $Term2 $_REQUEST["Term2"];
    $RemainingTerm2 $_REQUEST["RemainingTerm2"];
    $Rate2 $_REQUEST["Rate2"];
    $FMP2 $_REQUEST["FMP2"];
    $otherdebts $_REQUEST["otherdebts"];
    $MNI $_REQUEST["MNI"];
    $incometype $_REQUEST["incometype"];
    $SpouseMNI $_REQUEST["SpouseMNI"];
    $incometypespouse $_REQUEST["incometypespouse"];
    $moneyleft $_REQUEST["moneyleft"];
    $embody "$name $address $phone $estvalue $orgbal $currbal $loantype $orgterm $remainingterm $ROM $FMP $AtoE $MorBal2 $Curr2ndBal $ToM2 $Term2 $RemainingTerm2 $Rate2 $FMP2 $otherdebts $MNI $incometype $SpouseMNI $incometypespouse $moneyleft";
    $headers 'From: [email]euphoria.studio@gmail.com[/email]' "\r\n" .
        
    'Reply-To: [email]euphoria.studio@gmail.com[/email]' "\r\n" .
        
    'X-Mailer: PHP/' phpversion();

      
    mail"euphoria.studio@gmail.com""Analysis Request"$embody$headers );
    ?>
    Again I am not very strong in this area, but if that works, and you receive the email, it was definitely a problem with your mail header.

    Hope this helps!
    Last edited by tonyking; 02-14-2008 at 10:10 PM.

Bookmarks

Posting Permissions

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