PHP + Sendmail problem
Hi All,
I'm trying to get PHP to send mail to the outside world - which I might need to do one day if I decide to open up my webserver to the net... This is my little testing script: Code:
<?php Code:
Date: Mon, 3 Jul 2006 17:35:35 +0100 I have Googled without much success. The closest I have come to a solution was reading somewhere that I should have something in my /etc/mail/local-host-names file so I have tried both "localhost.localdomain" and "apache@localhost.localdomain" (there is no example of what form the entry should take) and in any case - it didn't work (I did re-start Apache before I tried again...) Is it a sendmail problem? Is it a PHP problem? Is it an Apache problem? Can anyone guide me through this? Many thanks to all... Mark |
It looks to me like the recipient's e-mail server rejected the message because it's from an obviously bogus e-mail address (apache@localhost.localdomain). You should give your machine a valid host name if you want to do this for real (if you've not got a static IP dyndns or no-ip can help).
Also, it's much simpler to use PHP's in-built mail function for this. IIRC you can use this to set the From address to whatever you want, so mnaybe you won't have to bother with the host name. Be advised, though, some mail servers flag messages with host names that don't match the originating server as spam, though. |
Quote:
Quote:
However. I do think you are on to something here because when I restart Apche I get the following error: Code:
[root@ArthurDent ~]# /sbin/service httpd restart Thanks again... Mark |
All times are GMT -5. The time now is 12:40 PM. |