0

I am trying to send email using SMTP library via php , every things go fine and I can send email successfully , But my problem is when I trying to send message to fake email which is not found like this (fdsffs@dsf.com) I get success message . this is my code

$mail->Subject = $subject;
        $mail->MsgHTML($message);


        if(!$mail->Send()) {
            $errors=$mail->getSMTPInstance()->getError();


            echo  $msg= "Message Not  Sent: to $to " . $mail->ErrorInfo;
            $date=date('Y-m-d h:i');

            $sql="insert into log (log_text,user_email,log_time,status)values ('$msg','$to','$date',0) ";
         $this->query_return($sql);
            exit();
        } else {$date=date('Y-m-d h:i');


             $sql="insert into log (log_text,user_email,log_time,status)values ( 'Message has been sent successfully ','$to','$date',1) ";
     $this->query_return($sql);
        }
    }
ahmad blat
  • 41
  • 1
  • 1
  • 4
  • You will only get a delivery fail email on the address the email was sent from – Masivuye Cokile Jun 10 '19 at 13:17
  • that what I already get , in my email. but I need to get the result in y system to generate logs – ahmad blat Jun 10 '19 at 13:23
  • Possible duplicate of [How to check if an email address is real or valid using PHP](https://stackoverflow.com/questions/19261987/how-to-check-if-an-email-address-is-real-or-valid-using-php) – Patrick Q Jun 10 '19 at 13:27

0 Answers0