Installed XAMPP. Understand the configuration of mail. To get started, just launched the mail() PHP function:

 mail('mail@example.com', 'the subject', 'the message'); 

and looked into the server's [error_log]; there appeared such a record:

sh: 1: -t: not found

I only understand that sh is a shell, and what does the rest mean, and why is it not found?

  • if you read the answers to this question, stackoverflow.com/questions/15965376/… then you will immediately understand what is -t. Most likely, you just need to correctly register your program, which sends mail. - KoVadim
  • I have already re-read a bunch of information and tried twice as much, but something does not work and the questions are dark ... I have Ubuntu, but the word “sendmail” is not in the system at all :). In short porridge. In my opinion, such motives should be resolved at the level of the OS, and not additional applications, etc. I will deal with it from the very beginning ... - Roman Grinyov
  • one
    Here help.ubuntu.ru/wiki/xampp is the answer to your question. But to put xampp on Linux ... at least ugly and insecure. Everything is in the repository. This is not a Windows. - KoVadim
  • You are undoubtedly right about "But putting xampp on Linux ... at least ugly and insecure." Thanks for the instruction: I put everything “native”, I still had to suffer from sendmail , which I never figured out on the FQDN issue - so I set everything up via msmtp . Here's a great article: digitalocean.com/community/tutorials/how-to-use-gmail-or-yahoo-with-php-mail-function . - Roman Grinyov

1 answer 1

PHP tries to execute the command to which the -t argument was passed, for example, php uses sendmail to send mail:

  sendmail_path "/usr/sbin/sendmail -t -i" 

Just check your settings in php.ini, where you have an extra or incorrectly written argument -t in the sh-command.