View previous topic :: View next topic |
Author |
Message |
whitetr6 n00b
Joined: 11 Mar 2005 Posts: 28
|
Posted: Wed Jan 10, 2007 2:09 pm Post subject: sendmail and php |
|
|
My mail server and web server are in two different places. The public mail server (MX) record for my domain is on a box out of my immediate control. The web server though is running Gentoo and I can change anything I want. So I'm setting up a CMS to play with (MODx). Out of the box it comes with a contact form that apparently uses sendmail and the php mail() function to send the message from the form. So I emerged sendmail, and then set the following in php.ini:
Code: |
sendmail_path = /usr/sbin/sendmail -t -i
|
and proceeded to test it with
Code: |
sendmail -v me@myemailaddress.com < mymsg.msg
|
That returns
Code: |
me@myemailaddress.com... Connecting to [127.0.0.1] via relay...
me@myemailaddress.com... Deferred: Connection refused by [127.0.0.1]
|
I think I understand that that means it will only send mail from the localhost itself. If I only want the server to send (not receive) mail, and PHP is on the same server, what would I need to do to allow the php mail() to work?
[Edit] Oh, and I'm running these commands from a remote ssh shell. Is that maybe the issue? Do I need to allow my firewall's public IP to relay in order for it to work from here? |
|
Back to top |
|
|
Dan Veteran
Joined: 25 Oct 2005 Posts: 1302
|
Posted: Wed Jan 10, 2007 2:50 pm Post subject: |
|
|
This has nothing to do with php or where you are connected to the shell from, It is your sendmail configuration. Did you setup sendmail after emerging it? _________________ - Failure is not an option. It's bundled with your software. |
|
Back to top |
|
|
whitetr6 n00b
Joined: 11 Mar 2005 Posts: 28
|
Posted: Wed Jan 10, 2007 3:00 pm Post subject: |
|
|
Nope, I didn't.
I found a how-to in the forums now. Thanks for your suggestion. I see the smart host option in the file I need to edit, along with a couple other things. Thanks again |
|
Back to top |
|
|
mose Guru
Joined: 04 Jun 2005 Posts: 313 Location: Piacenza
|
Posted: Wed Jan 10, 2007 3:17 pm Post subject: |
|
|
Why not using mail-mta/ssmtp ? If you simply want to send email using the php mail command, this is the easier method.
You configure ssmtp by putting in the conf file the details of the ssmtp server that you use with email address. |
|
Back to top |
|
|
|