php can't send mail
for some reason, php scripts that send mail, can only send it to ME, and no one else. I host my own mail, using the SMTP server IN OS X Server. So everything is on the same machine, so php can send mail to my machine, but no further. I can send mail, using Mail.app, no problem. I know php can use sendmail, but I'd rather just set it up simply to use SMTP, I know sendmail can be a real pain to set up.
Comments
also, in mail.app, what do you have as your outgoing smtp server? (is it ur localhost?) and are you connecting to the same outgoing smtp server in php? also, what do you use as your mailserver? (if not sendmail: the osx default, then postfix?) is it setup as a relay station to pass messages on to other final destinations?
Originally posted by thuh Freak
how are you dealing with mail in php? are you opening up a pipe into a mail server and handling the protocol yourself? or are you passing onto a separate program? or are you using some api?
also, in mail.app, what do you have as your outgoing smtp server? (is it ur localhost?) and are you connecting to the same outgoing smtp server in php? also, what do you use as your mailserver? (if not sendmail: the osx default, then postfix?) is it setup as a relay station to pass messages on to other final destinations?
I use the SMTP server that comes with OS X Server. Mail.app uses that for incoming and outgoing. It can relay mail but only mail that comes from its own IP, or a few certain other IPs. How php sends mail, I don't know, all my phps are downloaded.
in the mean time, try this (on the command-line):
telnet 127.0.0.1 25;
HELO me
MAIL FROM: [insert your login name without spaces or braces]
RCPT TO: [insert a separate email address you have on some other email server, like a yahoo or .mac, again without spaces or braces]
DATA
this is a test message
.
QUIT
(note the period on a separate line after the "...test message"; its needed.)
then wait up to 20 minutes and check the address from the "RCPT TO:" line. what that stuff does is connect to your local smtp server, and sends an email from [your log name] to the [separate email address]. its a test to see if your local smtp server will relay messages past your machine. if that works, then we know that php isn't properly sending mail; if it doesn't work then your mail server needs to be configured as a relay station.
edit: chg'd the code-block into a quote, cuz the formatting was really fukked up.
Originally posted by torifile
I'm a little confused about what mail.app has to do with your php sending mail. Sendmail and mail.app are two completely different things. Have you set up an MX record with your DNS host? (Maybe I'm misreading, but to send mail out to the world, I believe you need to do this.)
well, as i read it, he can send outgoing mail through his mail server in mail.app, but he can't send outgoing mail through his mail server in php pages. also, i dont think one necessarily has to route mail through their dns host. if sendmail is configured correctly, one can send mail through any mail server (or atleast thats what i think).
i think at this point, you should go to the php. ask whoever wrote it to point you in the write direction, or try grep'ing through the pages to find 'mail' or 'sendmail'.
Originally posted by Gargoyle
have you checked your php.ini file the correct settings ?
No i was very confused just where exactly that files goes on OS X and what is supposed to go in it.
Originally posted by l008com
No i was very confused just where exactly that files goes on OS X and what is supposed to go in it.
<?
phpinfo();
?>
put this script in a file (call it test.php or something) in your webserver folder (/Library/WebServer/Documents, if you haven't changed anything). Go to http://127.0.0.1/test.php . That'll give you a lot of info about your php setup. Then we'll get some needed information.
edit: make sure you delete the file when you're done. It may give info to hackers, so you don't want it lying around too long.