1

I have this error sh: /usr/sbin/sendmail: No such file or directory. I'm not Admin of that server. This is my php code:

<?php   $do = $email;
        $temat = 'Aktywuj swoje konto!';
        $od = 'From: x@domain.com';
        $serwer = 'mailng.domain.com';
        ini_set('SMTP', $serwer);

        $wiadomość = 'Hello $użytkownik. Musisz aktywować konto klikając link poniżej.
                     http://localhost/projekt/index.php?id=$id&kod=$klucz';

        mail($do, $temat, $wiadomość, $od);`
Anand S Kumar
  • 88,551
  • 18
  • 188
  • 176
MESSIAH
  • 19
  • 6
  • 3
    Your php configuration is such that `sendmail` should be used to send mails, but apparently that is not installed on the system. You need to either install it or configure php different. If you can't do that, then either tell the person responsible for that system or use a php based library to directly send the messages instead of using the `mail()` function. – arkascha Jul 26 '15 at 09:46
  • Ok. Many thanks for help. I will ask my provider about mail function. – MESSIAH Jul 26 '15 at 09:52
  • My provider say: We disable sendmail() if You need send email via php You should use phpMailer class. – MESSIAH Aug 01 '15 at 23:17
  • Which is exactly what I suggested above. That solution offers more features anyway. Have fun :-) – arkascha Aug 02 '15 at 03:18
  • Thanks for advice You make my day :). PhpMailer is very clever and simple to using. – MESSIAH Aug 05 '15 at 17:11

1 Answers1

-1

Not sure what your actual question is, but the most obvious thing to do would be to check if /usr/sbin/sendmail actually exists. If not, make sure you install an MTA.

zyxxyz
  • 79
  • 6