Page 1 of 1

PHP contact form only works sometimes

Posted: Tue Mar 01, 2011 2:23 pm
by Loougle
Not sure what the problem exactly is, but when I look into the email message details
[text]Received: (qmail 17800 invoked from network); 1 Mar 2011 17:46:49 -0000
Received: from unknown (HELO p3pismtp01-023.prod.phx3.secureserver.net) ([10.6.12.28])
(envelope-sender <commercialrs@p3slh159.shr.phx3.secureserver.net>)
by p3plsmtp12-05.prod.phx3.secureserver.net (qmail-1.03) with SMTP
for <accounts@crapower.com>; 1 Mar 2011 17:46:49 -0000
X-IronPort-Anti-Spam-Result: AmgCALa+bE3QbVBRkWdsb2JhbACYNAGOLAEBAQEJCwoHEQMivGSFYQSFEg
Received: from p3smtphosting04-02.prod.phx3.secureserver.net ([208.109.80.81])
by p3pismtp01-023.prod.phx3.secureserver.net with SMTP; 01 Mar 2011 10:46:49 -0700
Received: (qmail 3086 invoked from network); 1 Mar 2011 17:46:48 -0000
Received: from p3slh159.shr.phx3.secureserver.net ([72.167.131.40])
(envelope-sender <commercialrs@p3slh159.shr.phx3.secureserver.net>)
by p3smtphosting04-02.prod.phx3.secureserver.net (qmail-ldap-1.03) with SMTP
for <email>; 1 Mar 2011 17:46:48 -0000
Received: from p3slh159.shr.phx3.secureserver.net (localhost.localdomain [127.0.0.1])
by p3slh159.shr.phx3.secureserver.net (8.12.11.20060308/8.12.11) with ESMTP id p21Hkm0d012582
for <email>; Tue, 1 Mar 2011 10:46:48 -0700
Received: (from commercialrs@localhost)
by p3slh159.shr.phx3.secureserver.net (8.12.11.20060308/8.12.11/Submit) id p21HkmRg012579;
Tue, 1 Mar 2011 10:46:48 -0700
Date: Tue, 1 Mar 2011 10:46:48 -0700
From: commercialrs@p3slh159.shr.phx3.secureserver.net
Message-Id: <201103011746.p21HkmRg012579@p3slh159.shr.phx3.secureserver.net>
To: email
Subject: Online Authorization
X-Nonspam: Statistical 50%
X-BitDefenderWKS-SpamStamp: v1, build 2.8.100.133579, bayes score:
500(0), pbayes score: 0(0), neunet score: 500(0), flags:
[NN_LEGIT_SUMM_400_WORDS], total: 0(725)
X-BitDefenderWKS-Spam: No - 0
[/text]

Now I'm wondering if I can change the from fields to my own email would that help? I have a feeling that the servers are not sending the emails through because they are reading it as spam.

So you guys can see the code i'm using

Code: Select all

<p style: align="center"><form name="Autho" action="mail.php" method="POST">
<?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>

<input type="hidden" name="ip" value="<?php echo $ipi ?>" />
<input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
<input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" /> 
<div align="center">
<p class="style1">Name</p> 
<input type="text" name="name">
<p class="style1">Address</p> 
<input type="text" name="address">
<p class="style1">Email</p> 
<input type="text" name="email">
<p class="style1">Phone</p> 
<input type="text" name="phone">
<p class="style1">Debtor</p> 
<input type="text" name="debtor">
<p class="style1">Debtor Address</p> 
<input type="text" name="debtora">
<br />
<br />
<a href="authoforms.php" target="_blank" style="color:#ffcb00"  vlink="#ffcb00">Click here to view Assignment Agreement and Contract Agreement</a>

<p class="style1"><input type='checkbox' name='chk' value='I Have read and Agree to the terms.'> I have read and agree to the Assignment and Contract Agreement <br></p>
<p class="style1">Print Name</p> 
<input type="text" name="pname">
<p class="style1">Title</p> 
<input type="text" name="title">


<p class="style1">I hear by agree </p>
<select name="agree" size="1">
<option value="Agree">Agree</option>
<option value="Disagree">Disagree</option>
</select>
<br />
<br />
<p class="style1">Employee ID:</p> 
<input type="text" name="employee">

<br />
<input type="submit" value="Send"><input type="reset" value="Clear">
</div>
</form>
</p>

Code: Select all

<?php
$ip = $_POST['ip'];
$httpref = $_POST['httpref'];
$httpagent = $_POST['httpagent'];
$name = $_POST['name'];
$address = $_POST['address'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$debtor = $_POST['d'];
$debtora = $_POST['a'];
$value = $_POST['chk'];
$pname = $_POST['pname'];
$title = $_POST['title'];
$agree = $_POST['agree'];
$employee = $_POST['employee'];
$formcontent=" From: $name \n Address: $address \n Email: $email \n Phone: $phone \n D: $d \n  Address: $ra \n 'Client' has read Assignment and Contract Agreement: $value \n Print Name: $pname \n Title: $title \n I hear by agree that the information I have provided is true, accurate and the information I am submitting is not fraudulent. Please click the agree button that you adhere to Commercial Recovery Authority Inc.'s terms: $agree \n \n  Employee ID: $employee \n IP: $ip";
$recipient = "email";
$subject = "Online Authorization";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You!" . " -" . "<a href='index.php' style='text-decoration:none;color:#ffcb00;'> Return Home</a>";
$ip = $_POST['visitoraddress']
?>
I know these codes work cause they will work a few times, then stop working.

Re: PHP contact form only works sometimes

Posted: Wed Mar 02, 2011 2:13 pm
by danwguy
you $debtor value is wrong it should be $debtor = $_POST['debtor']; $debtora = $_POST['debtora'];
as far as why it's not working... it looks like its saying that it's spam and rejecting the mail. I would try changing the subject line to something less "spam-like" I had a credit form that people filled out and it shot an email to people and when I used the subject line "Credit Form" it rejected it as spam, I had to change it to "credit Form Confirmation" to get it to go through.

Re: PHP contact form only works sometimes

Posted: Wed Mar 02, 2011 4:48 pm
by Loougle
danwguy wrote:you $debtor value is wrong it should be $debtor = $_POST['debtor']; $debtora = $_POST['debtora'];
as far as why it's not working... it looks like its saying that it's spam and rejecting the mail. I would try changing the subject line to something less "spam-like" I had a credit form that people filled out and it shot an email to people and when I used the subject line "Credit Form" it rejected it as spam, I had to change it to "credit Form Confirmation" to get it to go through.
The web host provider is Go Daddy, is there something you think on their end they can do for this issue? I'll try changing the name, thanks for the help.