Email all subscribers when i do an action

You can directly query for users having a specific user_meta value. This will gain some performance over loading all the users first and then iterating over them and loading the meta_value afterwards.

Have a look at the WP_User_Query class.


If we are speaking of larger numbers of mails you may be better off to use a full-blown newsletter plugin (that will automatically queue the mails and not try to send them all at once). And if you are really sending a lot of mails (like +5.000 in one newsletter) I would advise you to use an external mail service provider (CakeMail, Mailchimp …).