Answer the question
In order to leave comments, you need to log in
php mail is not working. Why?
Hey!
Project in Yii2. Sending mail using the mail function does not work. Os debian 8. Php 5.6
Sending mail from console: echo 123 | exim4 [email protected]
exim 4 started : ps -e | grep exim4
phpinfo:
mail.add_x_header On On
mail.force_extra_parameters no value no value
mail.log /var/log/mail.log /var/log/mail.log
....
sendmail_from no value no value
sendmail_path /usr/sbin/exim4 -t /usr/sbin/exim4 -t
$to = '[email protected]';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: [email protected]' . "\r\n" ';
var_dump(mail($to, $subject, $message, $headers)); //false
Answer the question
In order to leave comments, you need to log in
I looked at what is in /var/log/exim4/paniclog
. There was also the following:
Unable to set gid=33 or uid(euid=0): forcing real=effective
...
Nano /etc/apache2/mods-available/mpm_prefork.conf
<IfModule mpm_prefork_module>
…
LimitUIDRange 0 2000
</IfModule>
Try giving the fifth parameter to mail like "[email protected]". Exim probably lacks the sender address and the From field in the headers is not enough for it. Examples are in the help.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question