jayswain Posted September 23, 2007 Share Posted September 23, 2007 Hi everyone. For a client's site, I use a simple php mail script for a contact form.To keep thing simple, the domain is abc123.com and I'm hosting this site (I have reseller hosting) The problem I'm having, is that for the $mailto , if I have it set as blah@abc123.com , then it won't work. but if I set the $mailto as anythingelse@anyotherdomain.com then it works perfect. I have a feeling it's somewhat of a backend issue ? or maybe I need to add something to the php script. Anything will help, thanks for reading. the code : <?php $mailto = 'blah@abc123.com'; $subject = " abc123.com - Main Contact Feedback" ; $submitsubject = "Thank you for contacting us" ; $formurl = "contact.php" ; $thankyouurl = "../html/thankyou.html" ; $uself = 0; $headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ; $firstname = $_POST['firstname'] ; $lastname = $_POST['lastname']; $email = $_POST['email'] ; $procedure = $_POST['procedure']; $find_us = $_POST ['find_us']; $comments = $_POST['comments'] ; $http_referrer = getenv( "HTTP_REFERER" ); $messageproper = "This message was sent from:\n\n" . "Name: $firstname $lastname\n" . "Email: $email\n" . "----------------------------------------------------------\n\n" . "Service: $procedure \n\n". "Comments: \n\n $comments\n" . "----------------------------------------------------------\n\n" . "This message was sent from this URL : $http_referrer \n\n Found via: $find_us \n" ; $response = "Dear $firstname,\n\n" . "Thank you contacting us, your message has just been sent to our inbox, and we will be contacting you shortly.\n\n" . "Thanks and have a great day.\n\n" . "ABC123 Company.\n\n" . "http://www.abc123.com \n" ; mail($mailto, $subject, $messageproper, "From: \"$firstname $lastname\" <$email>" . $headersep . "Reply-To: \"$firstname $lastname\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.07"); mail($email, $submitsubject, $response, "From: \"ABC123 Company\" <info@abc123.com>" . $headersep ); header( "Location: $thankyouurl" ); exit ; ?> Quote Link to comment https://forums.phpfreaks.com/topic/70392-simple-mail-script-wont-work-with-samedomaincom-addresses/ Share on other sites More sharing options...
BlueSkyIS Posted September 23, 2007 Share Posted September 23, 2007 I have a feeling it's somewhat of a backend issue ? most likely. my experience has been that it is almost never a problem with the mail being sent, but usually a problem with the mail being received. However, you might want to try sending without any additional headers and/or changing the values of the headers to see if you have better luck. Of course, don't forget to check your spam. Quote Link to comment https://forums.phpfreaks.com/topic/70392-simple-mail-script-wont-work-with-samedomaincom-addresses/#findComment-353626 Share on other sites More sharing options...
jayswain Posted September 24, 2007 Author Share Posted September 24, 2007 I posted on sitepoint.com as well, and somebody responded with this : There is no MX record for abc123.com, it point's to daemonmail.net, and daemonmail.net says abc123.com does not have permission to send or recieve mail through (mx1.daemonmail.net, mx2.daemonmail.net). Contact your host and have them setup your mail exchange or add relay permission to accept and send mail for abc123.com through their mail exchange. now I'm not sure if he was using abc123.com as an example, as I was, or if he was serious, but basically, does this mean i need to edit a dns zone, cname, mx record ? if so, I can. Thank you for your post bluesky Quote Link to comment https://forums.phpfreaks.com/topic/70392-simple-mail-script-wont-work-with-samedomaincom-addresses/#findComment-353741 Share on other sites More sharing options...
jayswain Posted September 24, 2007 Author Share Posted September 24, 2007 I notice in my dns zone for domain.com , I have a TXT record for domain.com. with a value of "v=spf1 a mx ~all" would this have anything to do with the problem ? Quote Link to comment https://forums.phpfreaks.com/topic/70392-simple-mail-script-wont-work-with-samedomaincom-addresses/#findComment-353749 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.