0

i have next code:

if (!mail($_POST['mail'], $text['EMAIL_RECOVER_MSG_SUBJECT'], $text['EMAIL_RECOVER_MSG'], $from)) {
    $msg = $text['MAIL_ERROR'];
    $msgDisplay = 'inline';
  }else {
    $recover = false;
    echo "<div class='alert alert-success'> {$text['RECOVER_MAIL_SENT']}</div>";
 }

and I try to send this message:

nati323@gmail.com
Password Recover: From dmworld24.com
You Forget Your Password To Recover it Please Go Into The Next Link:\r\n http://dmworld24.com/login.php?act=rec&token=11674209834514531801839026455 \r\n If You Didnt Ask For Password Recovering Just Ignore This Message
From: system@dmworld24.com

the code always show a success message, and the mail function return true, but i dont gey any mail in my mailbox, (and not in the spam) , i'm using xampp, and my php.ini is

sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

my sendmail.ini is:

smtp_server=smtp.gmail.com
error_logfile=error.log
debug_logfile=debug.log
auth_username=nati323@gmail.com
auth_password=*****
force_sender=nati323@gmail.com

why its doesn't work? and where can i see the mail log file for check errors?

some mark my question as duplicate, and gave a link to this: PHP mail form doesn't complete sending e-mail so i check all they say there,

1) my error reporting set to -1, and error display set to On.

2) as you can see i my comments i don't have any log file.

3) mail function return true

4) the mail doesn't found in the spam box

5) i supply the headers like they say there

6) i don't have headers syntax error

7) don't send to multiple accounts

8) i tried on host server that support mail, and doesn't work, and i try on my localhost i set the php & sendmail .ini files like you told me, still doesn't work...

Community
  • 1
  • 1
Kaki Baleven
  • 355
  • 3
  • 7
  • 19

1 Answers1

0

what is happening is that you do not have a live mail server configured in your php configuartion, the php mail() function forwards the mail to the local server so it will return TRUE but it is the job of the mail server to send mail or not, if your mail server is a public mail server then it will send the mail or else it will die in the local system itself.

I hope this helps you

Sourabh Kumar Sharma
  • 2,864
  • 3
  • 25
  • 33