Is there a way to find out why php mail function returns false (sometimes it happens)

I call the mail of the php function but it returns false

about 5% - 10% of the time and it is driving me crazy.

I think from php side everything is well set up because (correct me if I am wrong) if the function should not interrupt every time.

So the question is, how can I find out the reason for this behavior? What can I do to debug this?

+2


source to share


2 answers


I don't like PHP builds mail

for this reason. But my bounce rate was below 1%.



I suggest using PEAR :: Mail as described in this article . It uses an SMTP server to send emails. If an error occurs, you will receive the actual error message.

+1


source


One possible reason is, for example, poorly constructed From:



 Company Ltd. <company@gamil.com>
  => error (false)  - dot is problem

 "Company Ltd." <company@gamil.com>
  => OK (true)

      

0


source







All Articles