
|
View Full Version : PHP Mail() function not working on RaQ4i
Paul_M 11-02-2001, 09:15 AM Hello again...
I have written a simple test php script to send mail using the mail() function. It doesn't send mail.
It is on a virtual site.
It is as simple as
$to = "paul@anotherdmain.com";
$subject = "Test";
$msg = "Test";
$headers = "From: paul@mydomain.com\r\nReply-To: paul@mydomain.com";
mail("$to", "$subject", "$msg", "$headers");
Where mydomain.com is the domain name of the virtual site the script is on, and anotherdain.com is a different email account I have.
It's the latest php4 pkg. I have installed, and everything APPEARS to be OK to me.
Any advise welcome please.
Paul
:cartman:
ffeingol 11-02-2001, 10:53 AM Paul,
I assume you are not getting any errors from the php script, just no mail? Have you checked your mail logs to see if there is any info there? Have you created a phpinfo() script and make sure that you're pointing the the correct mail program?
Frank
Paul_M 11-02-2001, 11:06 AM Correct, no errors and no mail either.
I have made a phpinfo file, and it is pointing to sendmail in the correct place on the server.
Where/how do I check the mail logs?
Thanks
:cartman:
Paul_M 11-02-2001, 11:18 AM I've sent mail from the command line, and that worked, and there's no emails sent to root regarding any problems that I can see.
It's a dedicated RaQ4 with verio.
Any ideas?
Thanks
ffeingol 11-02-2001, 11:24 AM Well on the RaQ 4 that I help with, the mail logs are in /var/log/maillog.
Try sending it w/o the extra $headers and see what you get. I'm not 100% sure about the \r\n.
Frank
Paul_M 11-02-2001, 11:38 AM I'll check the logs, still no luck without the headers either.
:bawling:
Paul_M 11-02-2001, 12:01 PM Still nothing, I have removed all headers, no mail sent.
/usr/sbin/sendmail is the path to sendmail according to phpinfo(), this is the standard path, and I have checked, and it is there. I can send mail form the command line, and it goes through fine.
I am guessing this relates to the RaQ's relay hosts etc. that are allowed, although this is not for sure.
The thing I am wondering is if it relates to the relays and or host/domain aliases? Do I have to change anything here in the server admin for this to work? Or am I barking up the wrong tree?
Thanks again, I'm still trying. Paul
Paul_M 11-05-2001, 06:27 AM Oh boy, monday morning, things continue...
I've checked the mail logs, each time I run the mail() php function I get this:
Nov 5 10:21:41 www sendmail[31864]: gethostbyaddr(213.xxx.xx.xx) failed: 1
Nov 5 10:21:41 www sendmail[31864]: gethostbyaddr(213.xxx.xx.xx) failed: 1
Nov 5 10:21:41 www sendmail[31864]: gethostbyaddr(10.xxx.xx.xx) failed: 1
Nov 5 10:21:41 www sendmail[31864]: fA5ALfw31864: from=httpd, size=72, class=0, nrcpts=0, msgid=<200111051021.fA5ALfw31864@$
the xxx and the word www are of course not what I get, I get the full IP's.
I presume there is a problem somewhere with my RaQ setup that is not allowing email to be sent via the web/virtual domains. Users email accounts work fine.
Anyone help?
Thanks.
Paul.
monkey_boy 11-05-2001, 01:09 PM I hhad trouble with mail delivery and it turned out to be my DNS configuration somehow got crunched.
In the control panel (email server settings), make sure that domain is authorized to receive mail on the server. If all looks fine, consider looking at the files in /etc/named. Edit with pico -w if you see something strange. I know that sounds vague, but if you see something in your troubled domain that is different, you might consider changing it (make sure you have a copy of the original, though!)
Paul_M 11-05-2001, 01:35 PM Well, I fixed it.
Got rid of PHP (installed as a package from the cobalt site), installed it again (from cobalt) and it works?!
Thanks anyway.
|