Answer the question
In order to leave comments, you need to log in
How to set up php mail sending on the server from the Ispmanager panel?
I installed ispamanger on the server through roundcube, letters are sent, but when I try to send a php script mail('[email protected]', 'test', 'test')
, letters do not arrive in the mailbox, although the mail function returns true
Answer the question
In order to leave comments, you need to log in
If your server is not correctly configured to send emails, then it is quite possible that the email does not pass spam filters, try sending the email somewhere here temp-mail.org/ru for starters. If it comes there, then deal with the settings.
If it does not come, look at the logs of the application \ agent used to send (if you have postfix for example)
If PHP is in CGI/FastCGI mode, open the PHP settings as user and correct the sender address. There, by default, [email protected] The panel substitutes the domain only in Apache and PHP-FPM mode
If you have settings in php apache mode, go to domain settings and specify an existing admin email: [email protected]
Check if sending is configured in php.ini. If implemented via php cgi, edit the php-bin/php.ini file with the following line:
sendmail_path = "/usr/sbin/sendmail -t -i -f [email protected]"
You can find more information about the available functions at the link : https://www.php.net/manual/ru/mail.configuration.php
Please note that the mailbox that you specify as a return email for the mail function must first be created on your mail domain and be functional. Otherwise, the message will be marked as spam or rejected by the recipient's mail server. Also add SPF and DMARC records for the domain. Such records are necessary in connection with the introduction of more stringent sender verification by the leading mail services.
Try sending a test message with headers:
<?php
$to = "[email protected]";
$subject = "mysubject";
$txt = "Hello world!";
$headers = "From: [email protected]" . "\r\n" .
"CC: [email protected]";
mail($to,$subject,$txt,$headers);
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question