search

Home  >  Q&A  >  body text

php mail cannot send email

I am using Xiaoniao Cloud Server. PHP cannot use the mail function to send emails. I use codes to send emails. The sending always fails. I don’t know where the problem is.

想无想无1228 days ago1072

reply all(3)I'll reply

  • yntdx

    yntdx2021-09-15 09:13:58

    Check if the hostname is set correctly, or you need to set the sendmail path in the /etc/php.ini file. The method for setting the php sendmail path is as follows: open /etc/php.ini (not necessarily this path), and search; sendmail_path = change to sendmail_path = /usr/sbin/sendmail -t -i (not necessarily this path, you can find it through whereis sendmail). Then restart php and it will be OK.

    reply
    1
  • autoload

    autoload2021-09-14 13:55:18

    You don’t post code or error messages here. Are you posting an advertisement or asking a question? Sorry, nothing can be done

    reply
    2
  • 想无

    Error message: Mailer Error: Could not instantiate mail function

    想无 · 2021-09-14 15:03:05
  • Cancelreply