I'm coding a simple php code for sending e-mails from a MySQL table with a mailing list;
I'm doing the best I can to prevent errors from happening, to validate fields and do everything I can to prevent errors from happening.
I'm going to use a foreach loop to send each e-mail with names and other relevant information, but I'm worried that for some reason, some e-mail or name might raise an error and stop my code halfway through the list, leaving me with no way of knowing where it stopped.
I want to know if there's a way to skip the problematic row and keep on sending the e-mails, and then show details about the rows it failed sending.
I thought that I could use Try/Catch but I couldn't find if I could continue the code after the exception, and couldn't find how to append error mesages to display at the end.
If this isn't a good way to deal with possible errors, what's the best way?
Thanks in advance!