简体   繁体   中英

mail() function in PHP return bool false

I'm trying to send email using mail() function in php.

I'm on Localhost.

Here is my code :

$result = mail('recipient@gmail.com', 'Hello world', 'Some Message');
var_dump($result);  

It gives me this :

bool(false)

I'm facing this from last 2 days, please help !

My configuration of xampp is according to this link .

The reason is always the sendmail_from and sendmail_path are not correct with respect to your system in the php.ini settings even if the mail goes successfully but it will return false if the path is not correct. Please check those.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM