mail() function in php does not work
I am having a problem with the mail() function in PHP 5.3.2, I am running CentOS 6 with Apache 2.2.15
My problem is I am totally confused. Do I need to have postfix and DoveCot working before the smtp address I configured in /etc/php.ini will work? I have an smtp address configured in php.ini. What else do I need to do? Any help is greatly appreciated!!:D |
Hi there,
Quote:
Unix-like system usually do have an MTA, often postfix, that handles all SMTP communication on its own. Quote:
Actually, I don't understand either why you can't optionally have direct SMTP contact with PHP even on Linux. Dovecot is completely out of this game, by the way, that's an MDA, a Mail Delivery Agent. It deals with *incoming* mail. [X] Doc CPU |
Hi
The SMTP address in php.ini is for Windows only. On Linux, PHP uses the system's MTA (mail transfer agent) to send email. For postfix, you set the SMTP address by editing "/etc/postfix/main.cf" - set "relayhost = ip-number" and restart postfix. Also, you can usually check "/var/log/mail.log" or "/var/log/mail.err" if it doesn't work. Edit: I'm a slow typer... Also, another option is to use to use PEAR's mail system. Then you can bypass the system's MTA, and send it directly to the SMTP server you want. Example here: http://email.about.com/od/emailprogr...entication.htm |
I think the default on Centos/RHEL would be sendmail, its probably already setup.
However, you can use this page to check/amend http://linuxhelp.blogspot.com/2005/0...agent-mta.html |
All times are GMT -5. The time now is 03:18 PM. |