Re: mail working, not working. [message #182880 is a reply to message #182879] |
Mon, 23 September 2013 15:39 |
Peter H. Coffin
Messages: 245 Registered: September 2010
Karma:
|
Senior Member |
|
|
On Mon, 23 Sep 2013 11:15:11 -0400, bill wrote:
> In homage to Twane, I have a problem.
> This code does not work (mail returns true, but the mail
> is not received):--------------------------------------------
>
> // mail notification to office
> $userx = urlencode($user);
> $emailTo = "office(at)example(dot)com, william(at)example(dot)com";
> $message = "A new user registered. ";
> $subject = "A new user registered: $userx";
> $headers = <<<END
> From:office(at)example(dot)com\n
> END;
>
> mail($emailTo,$subject,$message,$headers);
> -----------------------------------------------------------
>
> As far as I can see, they are identical. But on the other hand,
> maybe I can't see.
>
> Both scripts run on the same server, neither has errors with
> error_reporting(E_ALL); set at the top of the script.
> Both require the same class.
>
> in both examples the domain name was changed to "example" by
> hand; otherwise they are copied, pasted, and reformatted to fit news.
>
> Any help and/or suggestions on how to proceed will be
> appreciated. To make it more fun: earlier in the development
> process both worked just fine.
Many "mail does not work" problems are not related to the PHP, but
rather to the mail itself being sent. Maybe the mail is rejected at the
remote end because it looks too much like spam, or because the sending
address is invalid, or because it's coming from a machine on a network
with a list of authorized machines to send mail and this thing is not
it. Mail() returning true only means that whatever the local submission
calls for completed successfully.
--
It's possible there had been armed autonomous droids at some point in
the past, and one can almost imagine past issues of that galaxy's Risks
Digest.
-- Anthony DeBoer, on SW: TPM
|
|
|