3 Replies - 396 Views - Last Post: 03 January 2019 - 08:39 AM Rate Topic: -----

#1 dorad   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 03-January 19

What can cause the “mail” function to return false negative?

Posted 03 January 2019 - 06:07 AM

Why does the following command returns false, while the mail is received at destination:

$result = mail( "[email protected]",'test subject','test message');
var_dump($result);

bool(false)

OS: Ubuntu 18.04

HTTP server: Apache2

PHP version: 7.2
Is This A Good Question/Topic? 0
  • +

Replies To: What can cause the “mail” function to return false negative?

#2 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 14856
  • View blog
  • Posts: 59,272
  • Joined: 12-June 08

Re: What can cause the “mail” function to return false negative?

Posted 03 January 2019 - 07:49 AM

Try using the adding your 'from' with ini_set('sendmail_from',
Was This Post Helpful? 0
  • +
  • -

#3 dorad   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 03-January 19

Re: What can cause the “mail” function to return false negative?

Posted 03 January 2019 - 08:07 AM

isn't it for Windows only?
Was This Post Helpful? 0
  • +
  • -

#4 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6734
  • View blog
  • Posts: 31,197
  • Joined: 10-May 07

Re: What can cause the “mail” function to return false negative?

Posted 03 January 2019 - 08:39 AM

The mail function delivers packets over the protocols. If php can't bind the port, the function would fail. The bool value is if the mail sent, not if it was delivered. I would check the system logs.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1