Send e-mail from admin area to adresses in custom field

First, decide whether you want to use GET or POST for your form. (without specifying the method, it will use GET.)

You will need the name attribute filled out for your textarea, so the info can actually be sent. Then add your form processing into your function:

(i.e. if ( isset($_POST["message"]) && !empty($_POST["message"]) ) {...} )

You will need to use get_post_meta( get_the_ID(), 'email_addresses' ) to retrieve the email addresses from the custom field. Store that value in a string variable. You will want to separate out the email addresses into an array (beware of the space – you should make sure your client knows if they should or shouldn’t have a space after the commas).

Then, you’ll need to loop through the array with a foreach, (because the PHP mail() function’s $to parameter does not accept arrays, only strings). You can build out your email form processing like the examples on this page.

Hope this helps! Let me know if you need any clarification.

tech