473,320 Members | 1,580 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Strange php mail problem

I am having a very strange problem sending email with php. I have two
domains. I can send an email to one domain using php but not the
other. If I put both email addresses in the mail command only the one
email will arrive. I can send emails the traditional way to the
problem domain and they arrive fine. Is there anything that might
explain this?

_______
Free Windows Clipboard Utility
http://www.clipboardmagic.com/
Jul 26 '05 #1
6 2012
On Tue, 26 Jul 2005 19:57:23 GMT, Mike the Canadian
<in*********@spam-killer-remove-techie.com> wrote:
I am having a very strange problem sending email with php. I have two
domains. I can send an email to one domain using php but not the
other. If I put both email addresses in the mail command only the one
email will arrive. I can send emails the traditional way to the
problem domain and they arrive fine. Is there anything that might
explain this?


Yes, but it'd only be a guess without more information, since there's lots of
things that could explain it (bugs in your code, misconfigured mail servers,
correctly configured mailservers rejecting the mail because of how you've sent
it, etc.)

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 26 '05 #2
Andy Hassall <an**@andyh.co.uk> wrote:
On Tue, 26 Jul 2005 19:57:23 GMT, Mike the Canadian
<in*********@spam-killer-remove-techie.com> wrote:
I am having a very strange problem sending email with php. I have two
domains. I can send an email to one domain using php but not the
other. If I put both email addresses in the mail command only the one
email will arrive. I can send emails the traditional way to the
problem domain and they arrive fine. Is there anything that might
explain this?


Yes, but it'd only be a guess without more information, since there's lots of
things that could explain it (bugs in your code, misconfigured mail servers,
correctly configured mailservers rejecting the mail because of how you've sent
it, etc.)


How can it be bugs in my code when it works for one address but not
the other? How can it be a misconfigured mail server when sending
email the traditional way works just fine? Why would one server reject
the mail because of how I sent it when the other will not reject it?

See below as to how I am sending the email:

@mail( "$myrow[1]", "password request","You had requested your
password to be sent to you. You can find your password
below.\n\nPassword: $myrow[0]", "From: Mail Admin <ad***@acme.co>");

Yes $myrow[0] and $myrow[1] are fine, I checked.

_______
Free Windows Clipboard Utility
http://www.clipboardmagic.com/
Jul 27 '05 #3
in*********@spam-killer-remove-techie.com says...
How can it be bugs in my code when it works for one address but not
the other? How can it be a misconfigured mail server when sending
email the traditional way works just fine? Why would one server reject
the mail because of how I sent it when the other will not reject it?

See below as to how I am sending the email:

@mail( "$myrow[1]", "password request","You had requested your
password to be sent to you. You can find your password
below.\n\nPassword: $myrow[0]", "From: Mail Admin <ad***@acme.co>");


Some mail servers will reject mail where an attempt to set a value for the
"from" address in the header (as you have done) is in conflict with the
message's canonical from address (likely to be apache@yourserver).

Try it using the optional fifth parameter in PHP's mail function:
$param='-fad***@acme.co'; // the -f at the front of the address is needed
mail($to, $subject, $body, $headers, $param);
and see if that fixes it.

Geoff M
Jul 27 '05 #4
>How can it be bugs in my code when it works for one address but not
the other? How can it be a misconfigured mail server when sending
email the traditional way works just fine? Why would one server reject
the mail because of how I sent it when the other will not reject it?


If your From: line doesn't indicate a mailbox you can ACTUALLY SEND
MAIL (specifically, a bounce message) TO, some servers will reject
it. Some mail servers, but not others, may have your web server
on their spam block list. If the mail contains the line: To:
<Undisclosed Recipients:;> some mail servers will reject it. If
your From: address isn't on the right whitelist, some mail servers
will reject it. In the Age of Spam, it's a wonder you can send
email at all.

Gordon L. Burditt
Jul 27 '05 #5
Geoff Muldoon <ge***********@trap.gmail.com> wrote:
in*********@spam-killer-remove-techie.com says...
How can it be bugs in my code when it works for one address but not
the other? How can it be a misconfigured mail server when sending
email the traditional way works just fine? Why would one server reject
the mail because of how I sent it when the other will not reject it?

See below as to how I am sending the email:

@mail( "$myrow[1]", "password request","You had requested your
password to be sent to you. You can find your password
below.\n\nPassword: $myrow[0]", "From: Mail Admin <ad***@acme.co>");


Some mail servers will reject mail where an attempt to set a value for the
"from" address in the header (as you have done) is in conflict with the
message's canonical from address (likely to be apache@yourserver).

Try it using the optional fifth parameter in PHP's mail function:
$param='-fad***@acme.co'; // the -f at the front of the address is needed
mail($to, $subject, $body, $headers, $param);
and see if that fixes it.


Weird, using -f I now get an "Unrouteable address" bounce.

_______
Free Windows Clipboard Utility
http://www.clipboardmagic.com/
Jul 27 '05 #6
in*********@spam-killer-remove-techie.com says...
Some mail servers will reject mail where an attempt to set a value for the
"from" address in the header (as you have done) is in conflict with the
message's canonical from address (likely to be apache@yourserver).

Try it using the optional fifth parameter in PHP's mail function:
$p*************@acme.co'; // the -f at the front of the address is needed
mail($to, $subject, $body, $headers, $param);
and see if that fixes it.


Weird, using -f I now get an "Unrouteable address" bounce.


On the target address that used to fail using your initial method, or
both?

One of the upsides to using the -f param method is that bounces are likely
to be returned to the nominated -f address whereas using your initial
method they may well have just gone to the apache account. If mail to
that apache account wasn't been set to /dev/null see if your initial
method was always bouncing mail to that address as well. If so, I suspect
it's a host/DNS problem between your PHP server and that target server.

Geoff M
Jul 27 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Carlos Ribeiro | last post by:
Hello all. I'm sending this to the list because I would like to know if someone else has ever stumbled across this one, and also because one possible solution is to patch, or simply "decorate",...
2
by: vamsikrishna_b | last post by:
Hello all,the following problem i encountered while transferring data(mail ids) from MS-outlook to one application.Some mail ids after came into the application looked as strange characters.Eg are...
2
by: Henok Girma | last post by:
Hello Gurus, i have a very strange problem that is killing me.. I have a stored procedure that e-mails, that stored procedure is called from diffrent table triggers.. on table a the trigers...
4
by: Nate Murray | last post by:
Hey all, I'm having a strange PHP (4.3.10) problem that seems to have something to do with javascript. This is a bit complex, so hold on to your hats. My issue is that a single function is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.