I am running a loop script in PHP command line, which send out emails to customers using PHPMailer. The problem I am receiving is that the command line script exits when the PHPMailer returns a false.
Here is the script pseudocode:
while(the loop is valid){
if(mail ID exists){
set_time_limit(30);
..compose mail..
if($mail->Send()){
..Mark as success in database..
usleep(10000);
} else {
..Mark as failure in database..
usleep(10000);
}
}
..continue loop..
}
If the $mail->Send()
returns a false, the script stops and exits. Is this an expected behaviour of PHP in command line? If that's the case, is there any way to tell PHP not to stop when it receives a false?
Thank you for any help.