CGI scripts cannot send mail

jwnmedia

Verified User
Joined
Nov 20, 2013
Messages
20
Hello, I am recieving the following errors from scripts trying to send mail. How can I resolve this? I believe its because I have email authentication set before email can be sent. Here is my mail lines from php.ini

[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = jwnmedia.com
; http://php.net/smtp-port
smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = [email protected]

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path =/usr/sbin/sendmail -t -i

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

I am using CentOS as the OS. The error I was getting before adding the sendmail path was as follows

mail() [function.mail]: Failed to connect to mailserver at "127.0.0.1" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()

After adding sendmail path no error is displayed and no email gets sent. If someone can help me with this I would be grateful.
 
I don't want to be forced to use an MTA. Email gets off the server fine the way things are. I would just like to get sendmail to work. What about if I use pear to send mail instead. The only thing stopping php from sending mail is that I do not have an open email server and you need to authenticate before sending mail.
 
If you're using SpamBlocker Version 4, then you may need to make a change to Edit#16; documentation is:
EDIT#16:
By default, we allow 127.0.0.1 as a relay host, which allows php, cgi
scripts, etc., to send email via smtp. To refuse local relay (and only
send email using the "sendmail interface", remove everything after the
word pophosts

SpamBlocker Version 4 allows this ad default, so you're probably not using it.

If you're using the default SpamBlocker exim.conf file which comes with DirectAdmin, then find this line:
Code:
hostlist relay_hosts = net-lsearch;/etc/virtual/pophosts
and instead make it look like this:
Code:
hostlist relay_hosts = net-lsearch;/etc/virtual/pophosts : 127.0.0.1
Be sure to restart exim any time you make a change to exim.conf.

Jeff
 
Back
Top