Saturday, September 23, 2023
 Popular · Latest · Hot · Upcoming
rated 0 times [  4] [ 0]  / answers: 1 / hits: 31029  / 1 Year ago, thu, september 8, 2022, 1:43:06

I have installed php, mySQL, postfix and sendmail and have set up a simple email script on my local host server. mail() returns 1 (TRUE) when I send an e-mail, however the email does not arrive at the destination.


The mail functions are part of the PHP core. There is no installation needed to use these functions.


For the mail functions to be available, PHP requires an installed and working email system. The program to be used is defined by the configuration settings in the php.ini file.

Runtime Configuration
The behavior of the mail functions is affected by settings in the php.ini file.

Mail configuration options:

Name            Default     Description                                         Changeable
sendmail_path NULL Unix systems only: Specifies where the sendmail
program can be found (usually /usr/sbin/sendmail
or /usr/lib/sendmail) PHP_INI_SYSTEM

I found it at /usr/lib/sendmail however, I can not find the configuration file, which is where I assume my problem is, as I have not told anything which server I am using to send my mail through.

If anyone can help me I would be grateful.

More From » php


You should not have both Postfix and Sendmail installed at the same time. Postfix is a replacement for Sendmail.

So remove Sendmail (because Postfix is easier to use):

sudo apt-get remove sendmail

Then you should reconfigure Postfix.

 sudo dpkg-reconfigure postfix

There is a very good guide here:

This will probably solve your problem.

[#30518] Thursday, September 8, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 361
Total Questions: 103
Total Answers: 113

Location: Turkmenistan
Member since Sun, Aug 2, 2020
3 Years ago
fenddy questions
Tue, Nov 22, 22, 10:11, 11 Months ago
Tue, Sep 27, 22, 09:16, 1 Year ago
Wed, Dec 28, 22, 13:09, 10 Months ago
Fri, Jun 18, 21, 14:04, 2 Years ago