1
<?php

  $email_to = "xxxxxx@xxxxxxxxxxx.com";
  $email_subject = 'Testing EXIM4';
  $email_message = 'exim test local';

  // create email headers
  $headers = 'From: qqqqqqqq@qqqqqqqqqqqq.com' . "\r\n" .
  'Reply-To: xxxxxx@xxxxxxxxxxx.com' . "\r\n" .
  'X-Mailer: PHP/' . phpversion();
  $result = mail($email_to, $email_subject, $email_message, $headers);

  if ($result)
  echo 'Mail accepted for delivery ';
  if (!$result)
  echo 'Test unsuccessful... ';
  ?>

I am using above code to send the mail (E-mail id changed) It prints

'Mail accepted for delivery '

but I am not receiving mail.Please help.

1 Answers1

0

mail Returns TRUE if the mail was successfully accepted for delivery, FALSE otherwise.

It is important to note that just because the mail was accepted for delivery, it does NOT mean the mail will actually reach the intended destination.

The above is from PHP mail documentation. If you want to be a bit more precise on validating mail delivery you could try PHPMailer.

Community
  • 1
  • 1