Ever seen a mail failure like this?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I've got a simple site that uses the PHP mail function to send a
"contact us" email to the site owner.  The mail code is straight out
of the PHP online manual, using a few addresses in the To header and
using the additional headers parameter (no cc or bcc).  And it acts
weird.  To be specific:

-the mail function returns a success code

-mail sent to other domains gets received

-mail sent to the same domain as the website never gets through

-mail sent from other domains to the domain email does get through

That is, the only thing that fails is sending the email from the
website to an email address of that same website.  Everything else
works as expected.

To make things more interesting, I uploaded the entire website onto
another host and from that host the non-working email addresses now
receive the email.  That is, if I run the website on HostCompanyA,
then the email is received where the domain is hosted by HostCompanyB,
but if I run the same code on HostCompanyB the email does not get

I've been talking with the hosting company but no luck so far.  Does
this problem ring a bell with anybody?


Re: Ever seen a mail failure like this?

Mike Silva wrote:
Quoted text here. Click to load it

Sounds like they have a "spam" feature that does not allow some email to
get get through from sites it thinks are spammers.. maybe their own site
is in their "filter".

you might be able to cobble a script together that uses telnet to
connect to port 25, send the appropriate headers, a simple hello world
message and disconnect and see if it succeeds... If not I suspect my
first assumption above is true.

I have not tried this, but looks promising...

http://www.geckotribe.com/php-telnet /

Re: Ever seen a mail failure like this?

Quoted text here. Click to load it

I had this issue with perl sendmail on one of my servers. The issue
arrises due to the fact that the website is on one server and mail is
on another server. Sendmail would recogonize that the domain name for
the recipient was hosted on the server and then look to see if the
email address was on the server, and since the mail was on a different
server it would look up the domain name, see that it is the local,
check if the email address was on it etc and get in a recursive loop
and eventually give up and not send the email. It would never send the
mail out of the server because of this domain name issue.

The fix was relatively simple using the apache gui, I just made the
mail domain for that site a different name (ie www.example.com and
mail was mail.aeaxample.com) and then the server didn't bother looking
and sent it out.

Bill H

Re: Ever seen a mail failure like this?

Quoted text here. Click to load it

Thanks, I'm going to pass this along to the ISP folks and let them
chew on it.


Re: Ever seen a mail failure like this?


on 04/24/2009 09:26 PM Mike Silva said the following:
Quoted text here. Click to load it

There can be many reasons for that to happen. I recommend that you watch
this slide presentation that talks precisely about sending messages that
actually reach the destination.


As for your problem, I recommend that you set the return path address
because it is very likely that the messages may be bouncing for some
reason. You need to see what the bounce messages say to understand the

Setting the return path address depends on the platform you are running.
 If you use this MIME message class and set the Return-Path header and
internally the class figures how to set the bounce address to what you
assigned to that header. Take a look at the test_email_message.php
example script.



Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs /

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org /

Re: Ever seen a mail failure like this?

mlemos wrote:
Quoted text here. Click to load it

Still pimping your site I see, Manuel.

Here's a unique (for you) idea.  Rather than just always spamming the
newsgroup with your site, why don't you actually CONTRIBUTE SOMETHING?

I guess it must be because you aren't able to answer questions yourself
- you have to find someone else to do it for you.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Site Timeline