Thanks for the detailed post.
That’s not really a “bug” with my plugin, but, rather, an issue with whatever plugin you are using to replace the WordPress email function with the function that uses Azure to send your emails. You may want to contact the developers of that plugin and let them know that their code won’t accept “to” addresses that are formatted that way, as that’s a pretty standard way (RFC 2822 standards) of formatting to addresses. I set up the formats to comply with what the wp_mail function accepts and expects… See this page on the wp_mail function and the “Valid Address Formats” section:
https://developer.www.ads-software.com/reference/functions/wp_mail/
When you use something like an SMTP email plugin, or a plugin to connect with a specific email service (such as Azure), then that plugin REPLACES the WordPress wp_mail function with its own wp_mail function (that’s how many WordPress functions were designed, so that they could be replaced/extended by other plugins). So, when my plugin calls wp_mail to send the emails, instead of now using the standard wp_mail function, your other plugin is substituting its own version of wp_mail so it can connect to the Azure mail servers. Nothing I can do about that in my own plugin as there is no easy way for me to figure out that another plugin has decided to replace the wp_mail function with its own function that is obviously not 100% compatible with the original wp_mail function.
Also, there’s another way for you to modify the “to” address that my plugin uses without having to directly modify the code (since you will lose your changes if you update my plugin when I release a new version). If you notice in that first screenshot you sent (the code editor where you added some code), line 83 on your code editor shows the filter hook I added to allow other plugins to modify the $to address variable before the wp_mail function is called (there are hooks to modify many things in my plugin). You could write a very small code snippet to hook into that filter hook, take the passed in $to variable, parse it to extract just the email from between the < and > characters, and return just that part as the return variable, and that would fix things with your Azure plugin. If you aren’t sure how to do that, you can do some internet searching on how to use WordPress filter hooks to modify things with your own code snippets, and you’ll find a ton of resources.
Of course the preferred way would be to let whoever made the Azure plugin know that they are not accepting valid email formats that WordPress itself accepts.