euphoriastudio Posted February 14, 2008 Share Posted February 14, 2008 Can someone take a look at my code and tell me what I'm doing wrong? From the visitors view, its working. But it doesn't actually send the info to my email. Thanks for the help! HTML 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( "[email protected]", "Analysis Request", $embody, "From: $name" ); header( "Location: http://formtest.freehostia.com/analysis.html" ); ?> Link to comment https://forums.phpfreaks.com/topic/91142-php-form-not-sending-to-email/ Share on other sites More sharing options...
PHP Monkeh Posted February 14, 2008 Share Posted February 14, 2008 Are you attempting to use this from your own localhost or on a web host? Usually web hosts have sendmail installed (if it's a linux based host) and sending e-mails should work fine because I can't see anything wrong in your code. Link to comment https://forums.phpfreaks.com/topic/91142-php-form-not-sending-to-email/#findComment-467116 Share on other sites More sharing options...
euphoriastudio Posted February 14, 2008 Author Share Posted February 14, 2008 I am using this code on freehostia.com (my webhost). I've also tried it on my client's host (godaddy.com with linux) and neither one is sending it to my email. thanks for your fast response! Link to comment https://forums.phpfreaks.com/topic/91142-php-form-not-sending-to-email/#findComment-467125 Share on other sites More sharing options...
rhodesa Posted February 14, 2008 Share Posted February 14, 2008 Try using a valid email from the same domain for your your From header, and add a die to see if the server is blocking your command, or the email is being sent to no mans land: mail("[email protected]", "Analysis Request", $embody, "From: [email protected]" ) or die("Can't send email"); ...also, check your spam filter... Link to comment https://forums.phpfreaks.com/topic/91142-php-form-not-sending-to-email/#findComment-467130 Share on other sites More sharing options...
euphoriastudio Posted February 14, 2008 Author Share Posted February 14, 2008 Oh wow! thanks rhodesa! That fixed it. I really appreciate you two taking your time to help! Link to comment https://forums.phpfreaks.com/topic/91142-php-form-not-sending-to-email/#findComment-467138 Share on other sites More sharing options...
rhodesa Posted February 14, 2008 Share Posted February 14, 2008 Yeah, this same topic has been becoming more frequent. For security reasons, hosts have been blocking email where the From header isn't from their domain. Otherwise, it's too easy for people to use their servers for phishing. Link to comment https://forums.phpfreaks.com/topic/91142-php-form-not-sending-to-email/#findComment-467143 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.