The code my plugin uses to set the “to” variable that is sent to the wp_mail function (which is the WordPress emailer function, not something I created), looks like this:
$to = $signup->firstname . ' ' . $signup->lastname . ' <'. $signup->email . '>';
which is the way WordPress recommends formatting an email address, so you end up with something like:
“john doe <[email protected]>”
However, if you look at the wp_mail function in WordPress it gives this detail for the input variables:
* @param string|string[] $to Array or comma-separated list of email addresses to send message.
So, WordPress will accept multiple email “to” addresses separated by commas. My guess is what happens in your situation is that the $to address was something like:
“Steve, John, and Mary <[email protected]>”
in which case, WordPress thinks it is 3 emails for the to address, but the first 2 don’t actually have a real email, so those will get rejected, but you should still get an email that would appear as “and Mary <[email protected]>”, which would still be deliverable.
On my local dev system, the above situation resulted in a delivered email as specified above. I didn’t get any bounce notifications, but not sure if my PHP mail catcher for testing emails would generate those. Also probably depends on if you are using the built-in WordPress wp_mail plugin, or if you are using an SMTP mailer plugin which replaces the wp_mail plugin. If using a SMTP mailer plugin that doesn’t validate the “to” addresses first, that could cause the errors.
The only way I could fix this on my end would be to strip out any commas in the first or last name before building the $to email address variable. I’m pretty sure I never use multiple “to” email addresses in my plugin, so that’s probably the best solution to avoid any issues.