You have a redirect set in the update above. That might be causing redirection before the page can finish... I'd start to debug by adding this to line 197:
die("sending to: ".$totalRows_EmailNotifications);
see if it says the number of rows you would expect the email to be sent to.