Here is my script:
<?php
if(isset($_POST['submit'])) {
$to = "username@comcast.net";
$referers = array ('www.mydomain.com','ip.add.re.ss','localhost');
$title = "This is a Message from Me";
$subject = $_POST['subject'];
$name_field = $_POST['name'];
$phone_field = $_POST['phone'];
$email_field = $_POST['email'];
$message = $_POST['message'];
$body = "$title \nFrom: $name_field \nE-Mail: $email_field \nPhone Number: $phone \nMessage: $message";
$headers = "From: " . $_POST['email'];
$success = mail($to, $subject, $body, $headers);
}
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=form_complete.htm\">";
} else {
echo "Sorry error please try again...";
}
?>
When I change the email to one of my many other addresses it sends just fine but not with comcast. Now when I remove the line
$headers = "From: " . $_POST['email'];
it will send to the comcast address fine. The reason I have that line in there is so that when the e-mail arrives to the client in the from column it will show their address and when the hit reply it will reply to the email that was specified in the HTML e-mail field.
So here is the header info from the e-mail to a NON COMCAST address with the $header line PRESENT:
Return-path: <USER@sclass.websitewelcome.com>
Envelope-to: me@mydomain.com
Delivery-date: Wed, 26 Dec 2012 11:35:36 -0600
Received: from USER by sclass.websitewelcome.com with local (Exim 4.80)
(envelope-from <USER@sclass.websitewelcome.com>)
id 1TnutE-0004pN-IG
for me@mydomain.com; Wed, 26 Dec 2012 11:35:36 -0600
To: me@mydomain.com
Subject: asdf
X-PHP-Script: clientdomain.com/contact/contact.php for 24.20.90.100
From: asdf@sd.vom
Message-Id: <E1TnutE-0004pN-IG@sclass.websitewelcome.com>
Date: Wed, 26 Dec 2012 11:35:36 -0600
And here is the header info from the e-mail TO A COMCAST address with the $header line REMOVED:
Return-Path: USER@sclass.websitewelcome.com
Received: from imta37.westchester.pa.mail.comcast.net (LHLO
imta37.westchester.pa.mail.comcast.net) (76.96.62.97) by
sz0126.ev.mail.comcast.net with LMTP; Wed, 26 Dec 2012 17:41:36 +0000 (UTC)
Received: from gateway16.websitewelcome.com ([69.93.82.10])
by imta37.westchester.pa.mail.comcast.net with comcast
id gHhb1k04i0DMimV0cHhbvp; Wed, 26 Dec 2012 17:41:36 +0000
X-CAA-SPAM: F00000
X-Authority-Analysis: v=2.1 cv=JcQEGi6V c=1 sm=1 tr=0
a=sgWM/mvALiMyOJTFXGCTww==:117 a=sgWM/mvALiMyOJTFXGCTww==:17 a=8FReB3YSAAAA:8
a=C_IRinGWAAAA:8 a=aH79pbpk914A:10 a=pRoFs2FcJPIA:10 a=vvU9AP6GoT3t0zE08ucA:9
a=VjdX41NSM4e9OE0V:21 a=b6eaiNkE2pqyrkpt:21 a=RjyaPFtIRPQA:10
Received: by gateway16.websitewelcome.com (Postfix, from userid 5007)
id 6BFD9D1DB8BC1; Wed, 26 Dec 2012 11:41:20 -0600 (CST)
Received: from sclass.websitewelcome.com (unknown [50.97.96.102])
by gateway16.websitewelcome.com (Postfix) with ESMTP id 5E28FD1DB8BA1
for <me@comcast.net>; Wed, 26 Dec 2012 11:41:20 -0600 (CST)
Received: from USER by sclass.websitewelcome.com with local (Exim 4.80)
(envelope-from <USER@sclass.websitewelcome.com>)
id 1Tnuz1-0001wY-JH
for me@comcast.net; Wed, 26 Dec 2012 11:41:35 -0600
To: me@comcast.net
Subject: asdf
X-PHP-Script: clientdomain.com/contact/contact.php for my.ip.add.ress
Message-Id: <E1Tnuz1-0001wY-JH@sclass.websitewelcome.com>
From: USER@sclass.websitewelcome.com
Date: Wed, 26 Dec 2012 11:41:35 -0600
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - sclass.websitewelcome.com
X-AntiAbuse: Original Domain - comcast.net
X-AntiAbuse: Originator/Caller UID/GID - [3232 32007] / [47 12]
X-AntiAbuse: Sender Address Domain - sclass.websitewelcome.com
X-BWhitelist: no
X-Source: /usr/bin/php
X-Source-Args: /usr/bin/php /home/USER/public_html/contact/contact.php
X-Source-Dir: clientdomain.com:/public_html/contact
X-Source-Sender:
X-Source-Auth: USER
X-Email-Count: 2
X-Source-Cap: ZGlzdHJpY3Q7YWdvbjAyNDtzY2xhc3Mud2Vic2l0ZXdlbGNvbWUuY29t
The "sclass.websitewelcome.com" is because I have hostgator reseller account so that is to hide from the clients that it is hostgator instead of my company. 🙂
So is there a header i can add or different way of having the e-mail address show up in the from column and have it auto insert the address when the client hits the reply button?
Sorry for the long code I just wanted to be thorough. I have been battling this for while and cant figure it out. '
Thanks in advance for any help,
Agon