Looking at the snippet you provided the solution seems to be your last solution.
$emails = array( $email, '[email protected]','[email protected]' );
Sending an array of emails, the first one ($email) being the dynamic email. The second and third would be hard coded values.
This is assuming the email handler is ready to accept an array of emails to mail to.
EDIT
I see some comments regarding your first attempt:
$emails = array( $email, '[email protected], [email protected]' );
This is a valid array – however will pass the value of [email protected], [email protected] instead of [email protected] and [email protected] as separate values – which by first glance is how the code is expecting additional email addresses.
Related Posts:
- How can I send an email using PHP?
- WordPress refuses to send mail, “…your host may have disabled the mail() function”
- How do I override the Message-ID header of wp_mail function?
- How to disable wordpress confirmation email for new users
- Best way to create a user programatically
- Should I use wp_mail or PHP’s mail? [duplicate]
- Mail not sent when I set HTML headers
- Send PDF link in email based on radio button selection
- Woocommerce HTML email option unavailable
- Trigger Woocommerce New User Email
- Processing a subscription form with POST method?
- Different Webhost and using Google Mail server: Is there a better way than SMTP?
- Attaching a pdf to Contact Form 7 e-mail via functions.php [closed]
- Setting up 2 SMTP accounts: 1 for wordpress and 1 for woocommerce
- Set a condition based on WooCommerce checkout city field while placing order
- WooCommerce – Email admin with new user details
- How do you ensure that a user is recognised and available for use only when it is verified through a row in the database called ‘accountVerified’?
- PHP 8, AJAX mail form to function.php doesn’t work
- Capture User Email Address When Filling Out Form
- Send multiple attachments with wp_mail in PHP
- How to retrieve the sender email with wp_mail()?
- Auto 301 to full post permalink? (using : /archive/%post_id% to %post_name% )
- Can I get an email notification when media is uploaded to the media library?
- Woocommerce Email attachments not working – file not being attached
- Get user custom field value on function.php
- Pass return-path additional parameter in wp_mail
- difference between sanitize_email ,FILTER_VALIDATE_EMAIL and input email type in html5
- Use of antispambot with $curauth->email
- How do I attach an invoice PDF to an email in the Dukapress plugin for WordPress?
- Contact form – problem with displaying message about sent mail
- How to setup the Email piping in WordPress plugin?
- Is it secure to use SMTP password in .php file in WordPress website?
- Send an e-mail on address with the link with disliked post
- I want to fusion the product columns in email table order
- Woocommerce checkout page – custom field checkbox value into email
- Changing default WPMU emails to be send thorugh Campaign Monitor Transactional emails
- Send email to users when they get new followers
- How can disable wordpress emails notifications?
- Woocommerce custom field on emails outputs ‘Array’
- Using Custom Javascript and pHp to send email to myself when a user clicks on an input button but only works on Chrome, IE, and Micorosft Edge
- Wp_mail doesnt work
- Trying send mail from Theme page
- get_post_meta is always empty when I use wp_mail
- Cron job to call php to email last 24 hours posts
- How to check “From Email” via WordPress before an email is sent
- How can I prevent wordpress from sending emails
- Dynamic Email Handler with ‘header (“Location: …’
- Customize the summary table of an order in the email
- Why does WordPress not send the user the email to add a password?
- Why is my custom email notification after purchase not sending?
- Send emails to individual subscribers when CPT post is deleted (trashed)
- WordPress admin area not sending mail (but works with WP Mail SMTP, Test Mail, and PHP mail() function)
- Remove wp-mediaelement.css from wp_head
- How to create a WP_Query to search the Title or Tag?
- Guidance with The Loop for CMS
- Disable External Pingacks on WordPress Posts and Only Allow ‘Self Pings’
- Using PHP in a Stylesheet (possibly a “.htaccess” problem?)
- Go to / Scroll to Password Field on WordPress Posts After Submit With Message(s)
- WordPress Redirect: Default Password Reset URL [duplicate]
- Changing the template hierarchy
- Remove an action hook within a Class
- WordPress Script stops suddenly
- Woocommerce api: create product with images – bad request
- WordPress admin pointers tour bug?
- Get term siblings of current child taxonomy
- Upload file could not be moved to wp-content/uploads
- HTML tags not showing in excerpt
- Add .htm extention to a custom taxonomy
- Insert custom PHP head above in WP pages
- Can we count the WordPress Loop
- Fixing Memory Leaks in WordPress (HHVM)
- How to remove sidebar primary widget on Mobile on category page [closed]
- add_filter function concatenate string and locate_template function
- get users search not working with array
- How to return a string that has a jQuery and Ajax inside in a shortcode?
- ‘pre_user_query’ interfering with user export
- Custom CSV exporter – Cannot modify header information – headers
- WordPress custom taxonomy
- How to check post meta isset or not empty during publish/save post?
- WordPress – Query specific category and automatically change category each month
- I can’t separate the array by commas
- How to add locations input to user profile?
- Get original value in save_post action hooka
- Warning: urlencode() expects parameter 1 to be string, array given in /wp-includes/formatting.php on line 5343
- How do I create a WP endpoint that retrieves all custom post types that have a tag?
- Displaying Children of several pages
- How do I fetch a data from an external database into my wordpress homepage
- Error when saving wordpress
- Position a repeated article blocks
- How to replace hard-coded list of custom taxonomy terms based on custom field query [closed]
- Add options to WordPress backend
- apply_filters() function
- How to define Og Meta Tags in header using conditions [duplicate]
- Using tag to output text in Genesis?
- images in wordpress themes
- How do you get a reference to $wpdb in a PHP script
- How to use multiple 404 Error Pages in WordPress
- How to initialise WP_Query on the basis of a specific meta_value and continue iterating rest?
- Custom Post Type doesn’t have template content when creating programmatically in PHP but does when created in WP Admin
- How to pass php array to external js file in WordPress