Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mail() function won't send to same domain

Status
Not open for further replies.

Muppsy007

Programmer
Apr 4, 2003
98
NZ
Hi,

I have a simple mail script for sending the results of a contact form:

[blue]$email = "email@homedomain.com";
$subj = "Enquiry from Website";
$header = "Return-Path:me@homedomain.com\r\n";

$header .= "From: " . $from_email . "\r\n"; $header .= "Content-Type: text/html; charset=iso-8859-1;\r\n\r\n";

$content_temp = str_replace("\r\n","<br>",$message);
$content_full = stripslashes($content_temp);
$mesg .= "<html><body>";
$mesg .= "From: " . $sender_name . "<br>";
$mesg .= "____________________________________________________<BR><BR>";
$mesg .= $content_full;
$mesg .= "</body></html>";

// SEND MESSAGE USING PHP mail() COMMAND
mail ($email,$subj,$mesg,$header);
?> [/blue]

Now the $email value is an address from the same domain as the website.

When the script processes, everything looks fine on the webpage, but no mail comes through.

Now if I change the $email value to anything other than an email from it's own domain, the email's come through.

Has anyone heard of anything like this? I've done a search here and the only posts seem to be based on the fact that script doesn't work at all. But this one does as long as the recipient address is not from the same domain.

And yes, I have sent test emails to the address in question and it works instantly.

Thanks in advance
Aaron

 
What happens if you use something like outlook or pine etc with the same kind of values (especially the same smtp server). Although this is not perfect (unless you can use the web server itself to run the email client)
I'd like to know if it's a php problem or an email problems.
are you under windows or *nix and finally look at phpmailler (on sourceforge) which is the defacto for email under php
:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top