PHP Mail command

apostle

Verified User
Joined
Jun 1, 2004
Messages
22
Location
chicago
I wasn't sure if this should be in the PHP or email section, since it's PHP code i figured it should go here. I transferred my websites to my new server. I have a place where people fill out "applications" and the forms are sent to a specific email using PHP. The problem is that it nothing is being recieved by the emails. I know the code is correct because it worked on the server it used to be on and i haven't changed it. Just seeing if anyone has any ideas as to what the problem could be like if sendmail isn't working correctly or something.

-Thanx
 
Hey,

DirectAdmin uses Exim... So, if it's looking for Sendmail, that might be the problem.

David
 
Yeah, seems like the problem:
For the Mail functions to be available, PHP must have access to the sendmail binary on your system during compile time. If you use another mail program, such as qmail or postfix, be sure to use the appropriate sendmail wrappers that come with them. PHP will first look for sendmail in your PATH, and then in the following: /usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib. It's highly recommended to have sendmail available from your PATH. Also, the user that compiled PHP must have permission to access the sendmail binary.

Anyone got any ideas of what i can do?
 
The sendmail wrapper is properly installed during a default DA install.

Jeff
 
ok, so do i have to reinstall a DA script or something since the php code isn't working
 
The first step is to do:

whereis sendmail

Here's what I get on my systems:

[jlasman@da1 custom]$ whereis sendmail
sendmail: /usr/sbin/sendmail /usr/lib/sendmail
[jlasman@da1 custom]$

Then do a directory listing for all returns.

I get:

[jlasman@da1 custom]$ ls -al /usr/sbin/sendmail /usr/lib/sendmail
lrwxrwxrwx 1 root root 16 Dec 15 2003 /usr/lib/sendmail -> ../sbin/sendmail
lrwxrwxrwx 1 root root 4 Jul 13 20:21 /usr/sbin/sendmail -> exim
[jlasman@da1 custom]$

What do you get?

Jeff
 
# whereis sendmail
sendmail: /usr/sbin/sendmail /usr/sbin/sendmail.old /usr/lib/sendmail /usr/lib/sendmail.old

# ls -al /usr/sbin/sendmail /usr/lib/sendmail
lrwxrwxrwx 1 root root 23 Jun 29 16:40 /usr/lib/sendmail -> /var/qmail/bin/sendmail
lrwxrwxrwx 1 root root 23 Jun 29 16:40 /usr/sbin/sendmail -> /var/qmail/bin/sendmail
 
Hey,

From the instructions:

sendmail_path string
Where the sendmail program can be found, usually /usr/sbin/sendmail or /usr/lib/sendmail. configure does an honest attempt of locating this one for you and set a default, but if it fails, you can set it here.

Systems not using sendmail should set this directive to the sendmail wrapper/replacement their mail system offers, if any. For example, Qmail users can normally set it to /var/qmail/bin/sendmail or /var/qmail/bin/qmail-inject.

What is the sendmail_path in your configuration (php)?

Appears as though it should be as mentioned above: /var/qmail/bin/sendmail

Is this a DA machine?

David

BTW, what is running on your machine... sendmail, qmail, etc.?
 
Last edited:
apostle,

If it's a DA machine running any flavor of RH, you can safely replace the sendmail symbolic links in your directories with the ones I've posted.

If it's not a DA machine then you'll probably have to ask someone on a list specific to what you're running.

Jeff
 
Back
Top