PHP mail() function returning false, but with no error

后端 未结 6 2031
傲寒
傲寒 2020-12-11 16:24

I am using php\'s mail() function for the simple process of E-Mailing the input of a contact form to the respective person. The strange thing is that the form always used to

6条回答
  •  情歌与酒
    2020-12-11 17:27

    More likely a host config. I think (but may be wrong) that mail() use the server mail command. So if you have no sendmail/postfix/ssmtp or other MTA installed on the server it cannot work.
    If they told you to address a SMTP server directly you should use another library that implements the SMTP protocol and a Mail class to build mail and send it via SMTP directly (in PEAR or Zend Framework PHP classes you'll find that)

提交回复
热议问题