PHP mail() function does not work on web-host

前端 未结 5 846
野趣味
野趣味 2021-01-26 00:25

I\'m having issues sending emails using the php mail() function. I know the php script I have works because I have an identical copy of it on another web-hosting company and it

5条回答
  •  离开以前
    2021-01-26 01:18

    Whatever the solution, check your mail()'s output.

    Most common solution

    Ask your hosting company if your current web host has SMTP set up to relay mail from your scripts. If they say "no", then they might have another SMTP host for you to use like smtp.example.com, or you'll have to use another SMTP relay (check with your current e-mail provider).

    Alternative

    The SMTP server you're talking to might not understand what your script is saying. I've seen situations before where my mail script will work with Postfix but not qmail. This is easily solved by using a third party e-mail library: there are tons out there, but my favorite is Flourish's (http://flourishlib.com/docs/fEmail).

提交回复
热议问题