Use PHP mail to send via smtp

前端 未结 5 1349
情话喂你
情话喂你 2021-01-20 11:41

Does anybody know if you can configure php\'s mail() command so it will only use an SMTP server rather than the local sendmail? We are having trouble with emails being marke

5条回答
  •  梦谈多话
    2021-01-20 12:19

    Just configure your local sendmail to use your upstream mail server as a relay! That way, you don't have to change anything on the PHP side.

    It would not be a good idea to send mail directly from PHP with SMTP, because you would lose everything from error handling to queueing this way!

提交回复
热议问题